1st batch file contains the call command
call "d:\sfd\dtsc\admt\bat\net use.bat"
Few lines from the 2nd batch file
:MENU
Echo Press 0 for Test
Echo Press 1 for Test1
Echo Press 2 for Test2
Echo Press 3 for Test3
Echo Press 4 for Test4
Echo Press 5 for EOF
Echo Press 6 for Exit
set /p input=Enter 1-6:
if %input% == 0 goto :Test
if %input% == 1 goto :Test1
if %input% == 2 goto :Test2
if %input% == 3 goto :Test3
if %input% == 4 goto :Test4
if %input% == 5 goto :EOF
if %input% == 6 goto :EXIT
:EOF
EOF
:EXIT
Exit /b
When I select :EOF it exits the 2nd batch file. Exit does also.
What command do I use in the second batch file to return to the 1st batch file?
Thanks in advance.
Return to the 1st batch file
Moderator: DosItHelp
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Return to the 1st batch file
A script run via call will return control to the script that called it once the second script is over.
That said, there's already a command called net use, so that may be causing issues. Never name a script the same thing as a command that already exists.
That said, there's already a command called net use, so that may be causing issues. Never name a script the same thing as a command that already exists.
Re: Return to the 1st batch file
Per your suggestion, I changed the second batch file to drivesmap.bat and it still doesn't return to the 1st script.
Any idea how to fix this?
Thanks
Any idea how to fix this?
Thanks
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Return to the 1st batch file
No, because it should be doing that automatically. Post your entire scripts and we'll be able to troubleshoot more effectively.
Re: Return to the 1st batch file
Thank you so much it worked.
As you suggested I have added a second call batch file in the original.
As you suggested I have added a second call batch file in the original.