Discussion Locked

Directing the cmd.exe in winxp to a line in a different batch...

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Was just wondering how this could be done in WinXp. Directing the cmd.exe to a line in a different batch file. Like this:
copy this.doc A:\dear
If not errorlevel 1 goto days (where days is a line in another batch file in the same directory as this one).
Lets say this one is called dell.bat
and the line above is meant to direct dell.bat to a line in kool.bat if the condition is not true, another batch file in the same directory.

Thanks for your anticipated contributions.

Matt.

1 reply

by p.j.hutchison

The best way to do this is pass parameters to your the called batch file which will check the value and goto the appropiate point in the batch file
e.g.
copy this.doc a:\dear
if not errorlevel 1 call dell days

dell.bat
if %1===days then goto days
...
:days

This discussion is closed to new replies.