Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PSEXEC "How To"

Posted on 2011-04-22
16
Medium Priority
?
949 Views
Last Modified: 2012-05-11
I'm trying to run a file named www.vbs on a remote computer on my LAN with PSEXEC but it is not working... When I execute the cmd:

psexec \\remotecomputer "c:\www.vbs"

I get:

exited on remotecomputer with error code 1

But nothing is happenign on the remote computer...any ideas?
0
Comment
Question by:wantabe2
16 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 35448208
What happens if you run the vbs file on the machine itself (rather than running it remotely)?
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35448229
It works fine if I run it on the machine itself....
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35448242
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:athomsfere
ID: 35448248
This file is on the remote machines C Drive?
0
 
LVL 25

Accepted Solution

by:
Ron Malmstead earned 1000 total points
ID: 35448249
Try this...

"cmd /c  c:\2.bat"
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 35448274
or,


"cmd /c c:\windows\system32\wscript.exe c:\www.vbs"
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35448851
I get:
"cmd exited on REMOTEMACHINE with error code 0"

BUT nothing still happens on the remote machine!
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35448856
yes, the file is located on the root of C
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35449251
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?
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35449259
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
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 35449261
..can we see the contents of your script ?
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 35449282
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.

0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 35449292
It must be something in the script that is not working properly.
Please post the contents of the VBS script.
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35449520
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

Open in new window

0
 
LVL 15

Author Closing Comment

by:wantabe2
ID: 35450274
still not working. i give up.
0
 
LVL 23

Expert Comment

by:Brian Gee
ID: 35450332
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question