Web Development

General discussion


Running bat file using a VBS script

By umang.jay ·
Hi All
I new to this website, so please forgive me if I'm doing this wrong.

I need help with trying to run a bat file once a user has logged on the the domain. basically I am trying to get a pop up to appear informing the user that the PC is shutting down as it is in the wrong OU. please call IT for Help.

I have setup 2 bat files & 1 vbs file. to help me do this. The 1st bat file is as follows & this is the one I have added to the OU as a GPO


xcopy %0\\..\wrong.bat %temp%\ /y/e/v
xcopy %0\\..\runasvb.vbs %temp%\ /y/e/v

cscript "%temp%\runasvb.vbs" username password %temp%\wrong.bat

The second bat file is

%windir%\system32\shutdown.exe -s -t 60 -c "Please move this Pc to the Right OU. Computer is shutting down."

The vbs file is

Set oShell = CreateObject("WSCript.shell")

sCmd = "%temp%\Wrong.bat"

for some reason It does not work. can you see where I am goin wrong?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums