wantabe2
asked on
PSEXEC "How To"
What happens if you run the vbs file on the machine itself (rather than running it remotely)?
ASKER
It works fine if I run it on the machine itself....
ASKER
I've even tried running:
psexec.exe -u domain\administrator -p the password \\remotemachine c:\2.bat
and I get an error code of 0 but nothing happens on the remote machine
psexec.exe -u domain\administrator -p the password \\remotemachine c:\2.bat
and I get an error code of 0 but nothing happens on the remote machine
This file is on the remote machines C Drive?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get:
"cmd exited on REMOTEMACHINE with error code 0"
BUT nothing still happens on the remote machine!
"cmd exited on REMOTEMACHINE with error code 0"
BUT nothing still happens on the remote machine!
ASKER
yes, the file is located on the root of C
ASKER
I can even try to run the basic:
psexec \\RemoteComputer cmd.exe
& it just sits there & does nothing on my machine........can anyone help me?
psexec \\RemoteComputer cmd.exe
& it just sits there & does nothing on my machine........can anyone help me?
ASKER
Let me re-phrase that, after I run the above cmd, it takes me to a c:\windows\system32 prompt on my workstation & does nothing on the remote computer
..can we see the contents of your script ?
psexec \\RemoteComputer cmd.exe
...is just going to sit there and do nothing, because you haven't given CMD a command to run.
Now if you did...
psexec \\RemoteComputer "cmd.exe /c batchfile.bat"
That will run the batch file....
Provided you bat file actually does something and is a functional working script...it should do whatever you made it to do.
...is just going to sit there and do nothing, because you haven't given CMD a command to run.
Now if you did...
psexec \\RemoteComputer "cmd.exe /c batchfile.bat"
That will run the batch file....
Provided you bat file actually does something and is a functional working script...it should do whatever you made it to do.
It must be something in the script that is not working properly.
Please post the contents of the VBS script.
Please post the contents of the VBS script.
ASKER
I just noiceed something, if I execute the .vbs script locally I have to click the "open" button to get it to run.....can I automate me clicking the "open" button on the remote machine with psexec or is this something that has to be done within the .vbs file? I've pated my .vbs code
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("%comspec% /K c:\2.bat"), 1, True
ASKER
still not working. i give up.
I see this is closed already, but you can get this to run using PSExec on a batch file on the remote computer to execute the VBS file, also on the remote computer. So this means, both the batch and VBS file need to be on the remote computer, and the batch file calls the VBS file into action accordingly.