I have two batch files..bat1 and bat2
bat1
has some code
if certain error level Call bat2 :starthere
...i want to call bat2 and not run the whole thing but start at certain point
My bat2 is something like this..
:StartHere
Echo bat2
and exit here and dont need to return to bat1.
can you please let me know if i can do this...
Thanks in advance
neep help with call command within the batch file
Moderator: DosItHelp
Re: neep help with call command within the batch file
Your bat2.bat could contain something like that:
The call in bat1.bat could be:
Regards
aGerman
Code: Select all
@echo off
if not "%~1"=="" goto %~1
...
:starthere
...
The call in bat1.bat could be:
Code: Select all
@echo off
...
call bat2.bat starthere
...
Regards
aGerman
Re: neep help with call command within the batch file
Hi ..I am getting...
bat2.bat is not a recognized as an internal or external programme....
Thanks,
bat2.bat is not a recognized as an internal or external programme....
Thanks,
Re: neep help with call command within the batch file
Have you saved the first code as bat2.bat in the same folder as bat1.bat? What's your OS? Try without the CALL command (only bat2.bat starthere).
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
Re: neep help with call command within the batch file
I wouldn't use the call command since it's not supposed to return to bat1. Otherwise you have to execute an exit command in bat2.