1

I'm trying to execute Delprof2.exe on multiple computers with multiple arguments and then output its results to a text file.

I'm testing on just one machine to start with so I've removed @Computers.txt and -d while testing. I can't get the output of Delprof2.exe written to the text file. From examples I've seen online I'm not doing anything wrong, but I can't get it to work.

I've tried:

psexec \\computer -i -u domain\account -p password "\\server\share$\DelProf2.exe" /l /ed:administrator* /ed:user1 /ed:user2 /ed:user3 /ed:user4 > "\\server\share\logs\%computername%.txt"
Results: Empty log file

psexec \\computer -i -u domain\account -p password "\\server\share$\DelProf2.exe" /l /ed:administrator* /ed:user1 /ed:user2 /ed:user3 /ed:user4 > "\\server\share\logs\%computername%.txt" 2>&1
Results:PSExec Copyright etc + \\server\share$\DelProf2.exe exited with error code 0

psexec \\computer -i -u domain\account -p password "\\server\share$\DelProf2.exe" /l /ed:administrator* /ed:user1 /ed:user2 /ed:user3 /ed:user4 2> "\\server\share\logs\%computername%.txt" 2>&1
Results:PSExec Copyright etc + \\server\share$\DelProf2.exe exited with error code 0
Daniel
  • 243
  • 1
  • 7
  • 16
  • I think psexec creates its own service on the remote machine, so it wouldn't log anything outside that "shell". You could try to pass the logging via > into the delprof2 call, like: `psexec \\computer -i -u domain\account -p password "\\server\share$\DelProf2.exe /l /ed:administrator* /ed:user1 /ed:user2 /ed:user3 /ed:user4 > \\server\share\logs\%computername%.txt"` ? – Lenniey Mar 26 '15 at 15:27
  • Thanks for your reply. If I enclose the exe and arguments in one set of quotes I get "the system cannot find the file specified". If I enclose the arguments in their own quotes (including the output argument) I get "psexec exited with error code 1", and there's still nothing in the log. – Daniel Mar 26 '15 at 16:17

0 Answers0