Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't call .bat file from within another - "not recognized as an internal or external command" error

i tried looking at the other questions regarding this, but no go. i've tried a straight call to the other bat file ("otherBat.bat," for instance), a "call" command, and even a "start" command. all of these are failing though, and i'm at a loss as to why. both .bat files are within the same folder, and i'm not changing directories, so i don't know what the problem is...

any help on this would be much appreciated ^_^

edit: sorry, here's the code :)

primary.bat:

echo Test run...enter variable1
set /p var1=:


echo Test run...enter variable2
set /p var2=:


call other.bat %var1% %var2%

pause

other.bat:

echo Working!
pause
like image 454
splatback Avatar asked Jan 22 '23 23:01

splatback


1 Answers

You should either cd to the current directory in your first batch file or call the second batch file by full path.

like image 193
ashurexm Avatar answered Jan 31 '23 03:01

ashurexm