I'm running a batch script that calls the binary NiniteOneTrial to install a bunch of apps listed in the "applist.txt". This works great, but I want to see if there is a way to setup a variable that prints to the screen (echo) the app that is currently being installed (per the applist.txt calls):
Basically, want to replace the %%CURRENTTASKFROMLIST%% with the app currently being installed from that list.
set CACHEPATH=\\server-01\local_apps\Ninite\netcache
set file_list=C:/ninite/applist.txt
:appinstall
for /f %%1 in (%file_list%) do (
echo . . . . . . . . . . . . . . . . [ Installing %%CURRENTTASKFROMLIST%% ]
cmd /c C:/ninite/NiniteOneTrial.exe /disableautoupdate /disableshortcuts /allusers /select %%1 /silent . /cachepath %CACHEPATH%
)
%%1you are using on the next line?%%1like you're doing on the next line.FORreplaceable parameters must be a LETTER (uppercase or lowercase) because the %-digit pair is reserved for the Batch file parameters. Although the %-digit also works inFOR(just made a test), this behaviour is completely undocumented! For examplefor %%1 in (%1) do echo %%1works in a Batch file, butfor %1 in (%1) do echo %1in the command-line also works with nonsense result. PLEASE, don't use %-digit inFOR, change it for %-letter! :)