|I need to pass some parameters from a bat, file1.bat to another bat, file2.bat. Problem is that @echo %2 inside file2.bat shows "" from prompt command, so the variable named secondVar defined inside file1.bat is not being send as it should be, while the first argument is always sending successfully.|
Notice that the echo !secondVar! appears at the console from file1.bat. But It does not retrieve when calling file2.bat from file1.bat
I'm stuck here therefore i cannot go ahead. Please someone could tell me what is happening and give me something right. Thank you very much in advance!
file2.bat looks like:
cscript process.vbs %1>result
more +1 %1|findstr /I /r /b /C:"^T.*=%2">viewout
file1.bat looks like:
@echo off & setLocal
for /f "tokens=*" %%a in (myFile) do (set secondVar="%%a"
call file2.bat "aFile" !secondVar!