Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On my SBS 2011 I have a batch file called wakeup-nas.bat, with the following contents:

wol.exe 5475e0d59ffa

wol.exe is an executable for sending wake on lan packets. It is in the same directory as the batch file.

Strangely the command is only working when I write it directly in the command prompt. When I open the batch file nothing happens, although I see the output from wol.exe that the packet has successfully been sent.

I also have tried to open the batch file "as administrator" with no success either.

share|improve this question
    
does it work if you specify the full path to it? –  Petter H Aug 18 '13 at 10:54
    
A couple of possibilities: Put a pause at the end off your batch file and let it hang there for a while. Does the command still fail? (Can you post the output?) Also, put a set at the beginning of the batch file and compare it with the output of set in a command prompt. There may be some context differences you can spot. –  SmallClanger Aug 18 '13 at 11:08
    
Is WOL.exe in your path or the working directory of the batch file? I'm guessing not. –  MDMarra Aug 18 '13 at 14:30
    
wol.exe and the batch file are in the same directory –  Alex Aug 18 '13 at 15:45

2 Answers 2

Try putting the full path to wol.exe. Also try putting an echo statement on your batch file. That might help.

share|improve this answer

Hmmm. I don't really know why, but it's working now with the batch file too, even without "run as administrator". May have something to do with the network card drivers I updated yesterday.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.