By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!@nickles @rconn
Sample batch file to show all you ever wanted to know about the running batch, but didn't know how to ask.
@echo off
for /f "tokens=* delims=?" %%d in ('cd ') do set start_drv=%%~dd& set start_dir=%%~pd
echo Starting drive = %start_drv%
echo Starting directory = %start_dir%
for /f "tokens=* delims=?" %%d in ('cd ') do set start_dir=%%~pd
echo Starting directory = %start_dir%
for /f "tokens=* delims=?" %%d in ('cd ') do set start_dir=%%d
echo Starting directory = %start_dir%
echo Starting command line = %0 %*
echo %%0 = %0
echo Running batch file name = %~nx0
echo Location of Running batch file name = %~dp0
echo FQN for Running batch file name = %~dpnx0
Also it appears TCC can't handle the 2nd command "& set start_dir=%%~pd" on the "for /f" line and fails to execute it
And when run as a single command, does not get the correct value for the path - it truncates the \TCMD21 folder of the path
OK. I couldn't find any doco on how the debugger is "fed".The contents of %0 depend on how you invoke the batch file (partial name, full name, partial path, full path, etc.), and is identical in both TCC and CMD. What you see in the IDE is because the batch debugger starts the batch file with a full path + full name.
@rconn Thanks for the correction Rex - I missed that when I collapsed the command group of the "FOR" down to a single lineYour syntax is incorrect (for both CMD and TCC).
@mikea I am only on the third day of evaluating Take Command's IDE & debugger and already up to my Fourth "BUG report"I can't help wondering: Why be saddled with some of cmd.exe's most painful 'features' — having to use clumsy 'for' loops to derive certain information. for example — when TCC's own solutions are so much simpler?