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.

We are trying to copy 3 files from our domain controller to a user PC and have it execute from a .bat file when a user logs in via Active Directory.

When we associate the .bat file to a user in AD for their logon, the PC copies down the 2 files, but the executable isn't launched.

Am I doing something wrong here?

Here is the script in question:

mkdir c:\stinger_dl
copy \\DC01\netlogon\install\PsExec.exe c:\stinger_dl\
copy \\DC91\netlogon\install\stinger.exe c:\stinger_dl\
c:\stinger_dl\psexec.exe /accepteula -u domain\admin -p MagicPassword -d -h c:\stinger_dl\stinger.exe --SILENT --ADL --GO --RPTALL --DELETE --REPORTPATH=c:\stinger_dl

We had a nasty virus outbreak last Friday (current virus protection missed it) and are trying to force a scan on all user PCs with Stinger when they login tomorrow.

Anyone interested, this is the virus that got us

share|improve this question
The script works on XP machines fine. The issue we ran into was Win7 and higher because of UAC. That is why we decided to try the GPO route since those logon commands run elevated from AD. I'll try the pause command now and get back to you. –  ProfessionalAmateur Mar 25 '13 at 3:51
add comment

1 Answer

Using group policy you could add the .exe to run on start up on its own, not via a .bat file? Will still allow you to have your parameters etc.

User Configuration > Windows Settings > Scripts(Log on/Log off) Just add the exe here with the parameters.

share|improve this answer
We tried that, we finally got Win7 and XP to work, but Win8 was still giving us fits. We only have 5 Win8 machines at this point so Im calling it a night. –  ProfessionalAmateur Mar 25 '13 at 5:07
What did you do to make it work on both xp & 7? –  Dan Mar 25 '13 at 5:21
The XP worked from the start. Once we removed the PSEXEC call it worked on Win7 straight from a .bat file. Win8 still seems to prompt with some form of UAC regardless... Its really odd. –  ProfessionalAmateur Mar 25 '13 at 6:44
add comment

Your Answer


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.