Search found 5 matches

by martin11ph
29 Jan 2013 09:16
Forum: DOS Batch Forum
Topic: If code does not execute because of first line
Replies: 12
Views: 9559

Re: If code does not execute because of first line

I am so not a big fan of using predefined commands as labels or batch file names. Too me it is not a good coding practice. So that is what you meant. I changed the :ping label on shirulkar's suggested code. I didn't recall the original file I had was a ping_psloggedon.cmd @OP: Don't call your batch...
by martin11ph
29 Jan 2013 08:36
Forum: DOS Batch Forum
Topic: If code does not execute because of first line
Replies: 12
Views: 9559

Re: If code does not execute because of first line

Hi Squashman,

Even with a different label it still does not work though.

Hi shirulkar,

I tried it on a Windows 7 machine and it runs fine. However, I need this to run on an XP machine. Do I need different codes?
by martin11ph
29 Jan 2013 07:58
Forum: DOS Batch Forum
Topic: If code does not execute because of first line
Replies: 12
Views: 9559

Re: If code does not execute because of first line

I see. I tried removing the echo to see where it stops. It stops at the ping command and then the error appears. I tried removing if errorlevel 1 goto exit but it still does not execute the next line. Last lines in cmd prompt would be C:\>ping -n 1 -i 200 -w pcnamehere The system cannot find the bat...
by martin11ph
29 Jan 2013 07:37
Forum: DOS Batch Forum
Topic: If code does not execute because of first line
Replies: 12
Views: 9559

Re: If code does not execute because of first line

Hi thanks for the quick response. :D

I'm getting
The system cannot find the batch label specified - ping_psloggedon.cmd

I tried changing do call to do goto but it doesn't seem to jump to the label.
by martin11ph
29 Jan 2013 07:16
Forum: DOS Batch Forum
Topic: If code does not execute because of first line
Replies: 12
Views: 9559

If code does not execute because of first line

Hi guys, I am following the code here at m because I need a batch script that checks a list of pcs in a txt file if they are on. If they are on, pslogged on is called. Start.cmd FOR /F %%x in (c:\temp\pclist.txt) do call ping_psloggedon.cmd %%x ping_psloggedon.cmd ping -n 1 -i 200 -w 130 %1 if error...