1.

Solve : Label Issue?

Answer»

I FINALLY got my batch file to WORK on my pc at home, brought it to work and I ran into a slight issue.
I have got a GOTO COMMAND at the begining of my code and it works if you change what its refering to with no problem. The problem is at the end where the labels reside

I have got at the begining
if not exist Z:\dcal1 goto LostDrive

This is a few lines down
if not exist Z:\dcal1 goto NoDrive


and at the end of my code I have

:NoDrive
echo my message
goto end
:LostDrive
echo my message
:End
Exit
for some strange reason when it gets to the end its readng the label and prompting the message.
I have moved the labels around, and whatever is at the top is where it starts

The colon should keep it from running RIGHT?

Confused!
Prompting what message? I don't understand the problem, but maybe try this instead:

Code: [Select]:NoDrive
echo my message
goto :EOF
:LostDrive
echo my message
goto :EOF



Discussion

No Comment Found