Open jesus2099 opened 1 year ago
Here is what happens on my Windows 10 Professionnel 22H with Python 3.11.5.
First I run isrcsubmit_original.bat
which is the original download.
You cannot see the new CMD.exe
terminal window that appears and disappear with no time to read the output.
Then back on the original terminal with the pause message, for nothing.
Then I run my patched isrcsubmit.bat
which displays output in same original terminal and that does not show useless pause message.
I will add a commit that enables a pause message, only when launching isrcsubmit.bat
from mouse double-click, there it is needed.
I have now added this code that will pause the script only when it is launched by mouse double-click (pause useful to see messages before terminal closes), and not when launched from CLI (pause useless):
echo %cmdcmdline%|findstr /c:"%~nx0" >nul
if %errorlevel% equ 0 echo.&pause
Same on my new new office laptop:
CMD.exe
or Windows TerminalMaybe it's only an issue in Windows Terminal, No I reproduce same problem with CMD.exe
right now, but anyway the new code is great because then the script pauses appropriately when run from mouse double-click from File Explorer and does not pause when run from a command line.
Summary
Patching the Windows-only
isrcsubmit.bat
file.Without this patch
With this patch
I have a new PC with Windows 10 Pro and the
isrcsubmit.bat
command is unfortunately:isrcsubmit.py
in new windowRunning
python <path>\isrcsubmit.py
instead ofisrcsubmit.py
fixes this problem.I also fix the problem that work variable
cp
is added to environment variables. I keep it local to the script, instead, withsetlocal
.I have also added a code to pause the script only when launched from file explorer, with mouse, and not when launched from command line.