Hi All,

Is there a way to run a command on a remote computer
through vbscript?

The command would be something like
"\\Myserver\Share\something.exe"

Thanks

Brett

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

RE: Run command on remote computer by anonymous

anonymous
Tue Mar 02 09:01:12 CST 2004

This article describes the basic process you are looking for

http://support.microsoft.com/?kbid=827227

Re: Run command on remote computer by Torgeir

Torgeir
Tue Mar 02 18:47:09 CST 2004

"brett.wilson@cgey.com" wrote:

> Is there a way to run a command on a remote computer
> through vbscript?
>
> The command would be something like
> "\\Myserver\Share\something.exe"

Hi

You can e.g. use WMI for this, but to be able to access network resources
(your UNC path above), some requirements needs to be in place, you need
to run Active Directory and e.g. you need to have granted the user and
the remote computer Delegate impersonation level rights (using e.g. the
Active Directory Users and Computers GUI), and you will need to specify
the Kerberos protocol in your WMI binding string.

Install Software on a Remote Computer
http://www.microsoft.com/technet/community/scriptcenter/compmgmt/scrcm28.mspx

More about this here:
http://groups.google.com/groups?selm=3E0251D8.74EE73F1%40hydro.com

and here
http://groups.google.com/groups?selm=40048C82.86AB2C40%40hydro.com


To avoid this delegation issue, you could consider copying
the msi file over to the remote computer first, using the admin
share (\\<computer>\C$"), and then run it using WMI.



Alternatively of trying to get WMI to work for you, here is a
couple of command line utilities you might want to try out:

Take a look at PsExec.exe in the free PsTools suite, found at
http://www.sysinternals.com

PsExec can even automatically copy a file over to the remote computer
before it starts it.


Another freeware program with similar merits to PsExec is Beyondexec.
http://www.beyondlogic.org/consulting/remoteprocess/BeyondExec.htm

Beyondexec also have multiple computer functionality.



--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/community/scriptcenter/default.mspx