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.

I'm trying to write some .bat files for GPO. I would like a way to see the output of the script to help debug problems. For the life of me I can't get it to log anything.

I have tried the following...

I created two batch files. The first had one line "call startup.bat > c:/startup.log", and the 2nd one was real startup.bat file. It didn't create the log file when I rebooted the computer the GPO was applied to. I did a "gpresult /z" which showed the policy being applied to the computer in question.

Then I delete the first batch file and change the policy to have the Parameters of " > c:\startup.log" still not working.

The startup.bat file is just some commands to generate some output. dir ipconfig /all

Never mind it seems to be working now. Not sure what I did to get it working. ???

share|improve this question
2  
Could you show us what you've tried? –  Chris McKeown Nov 21 '12 at 23:03
1  
Can you show us the actual .bat files? –  MDMarra Nov 26 '12 at 15:24

1 Answer 1

It sounds like the user is not an administrator and/or the CMD prompt is not running with elevated privileges. Try piping your output to a safer folder like so:

call startup.bat >%temp%\startup.log
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.