Starting a Process on a Remote System 
Author Message
 Starting a Process on a Remote System

I'm using the following code to start a process on a remote system, and it
works great as long as the path to my executable resides on the same remote
system.

If  I specifiy a network path for my executable, either through UNC or
mapped drive letter it fails with an access denied message.  I've also tried
specifying numerous privileges in the GetObject command with no luck.

Does anybody know if there is a way around this, or is it a limitation of
the win32_process.create method.

Thanks,
Droid

strComputer = "webserver"
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}\\" & strComputer &
"\root\cimv2:Win32_Process")

Error = objWMIService.Create("notepad.exe", null, null, intProcessID)
If Error = 0 Then
    Wscript.Echo "Notepad was started with a process ID of " _
         & intProcessID & "."
Else
    Wscript.Echo "Notepad could not be started due to error " & _
        Error & "."
End If



Thu, 24 Mar 2005 05:08:56 GMT  
 Starting a Process on a Remote System

Quote:

> I'm using the following code to start a process on a remote system, and it
> works great as long as the path to my executable resides on the same remote
> system.

> If  I specifiy a network path for my executable, either through UNC or
> mapped drive letter it fails with an access denied message.  I've also tried
> specifying numerous privileges in the GetObject command with no luck.

> Does anybody know if there is a way around this, or is it a limitation of
> the win32_process.create method.

Hi

I forgot about one other workaround that might apply to you:

If you want to do a remote installation that is unattended (no user input) and
single file install file based, you can use PsExec.exe in the free PsTools suite

from Sysinternals for this (will work on Win NT 4.0, Win2k and WinXP).

http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

To install e.g. q323759.exe remotely, do like this:

psexec.exe \\some_computer  -c C:\q323759.exe /q:a /r:n

The file "behind" -c must exist on the computer running PsExec.
PsExec will copy the specified program to the remote system for execution and
run it with the additional switches. After the install, the file q323759.exe
will be deleted from the remote computer.

If not domain, username and password can be supplied:
psexec.exe \\some_computer -u user -p pwd -c C:\q323759.exe /q:a /r:n

See here for a complete VBScript example that installs SW on a list of computers

in a text file using PsExec:


Subject: Re: Auto-Installing WMI
Newsgroups: microsoft.public.win32.programmer.wmi
Date: 2002-08-12 20:04:56 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=3D58758B.3139...

--
torgeir
Microsoft MVP Scripting and WMI
Porsgrunn Norway



Thu, 24 Mar 2005 05:43:00 GMT  
 Starting a Process on a Remote System
You're awesome dude, Thanks

Droid



Quote:

> > I'm using the following code to start a process on a remote system, and
it
> > works great as long as the path to my executable resides on the same
remote
> > system.

> > If  I specifiy a network path for my executable, either through UNC or
> > mapped drive letter it fails with an access denied message.  I've also
tried
> > specifying numerous privileges in the GetObject command with no luck.

> > Does anybody know if there is a way around this, or is it a limitation
of
> > the win32_process.create method.

> Hi

> I forgot about one other workaround that might apply to you:

> If you want to do a remote installation that is unattended (no user input)
and
> single file install file based, you can use PsExec.exe in the free PsTools
suite

> from Sysinternals for this (will work on Win NT 4.0, Win2k and WinXP).

> http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

> To install e.g. q323759.exe remotely, do like this:

> psexec.exe \\some_computer  -c C:\q323759.exe /q:a /r:n

> The file "behind" -c must exist on the computer running PsExec.
> PsExec will copy the specified program to the remote system for execution
and
> run it with the additional switches. After the install, the file
q323759.exe
> will be deleted from the remote computer.

> If not domain, username and password can be supplied:
> psexec.exe \\some_computer -u user -p pwd -c C:\q323759.exe /q:a /r:n

> See here for a complete VBScript example that installs SW on a list of
computers

> in a text file using PsExec:


> Subject: Re: Auto-Installing WMI
> Newsgroups: microsoft.public.win32.programmer.wmi
> Date: 2002-08-12 20:04:56 PST

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=3D58758B.3139...
hydro.com

- Show quoted text -

Quote:

> --
> torgeir
> Microsoft MVP Scripting and WMI
> Porsgrunn Norway



Thu, 24 Mar 2005 07:28:38 GMT  
 Starting a Process on a Remote System



Quote:

> > I'm using the following code to start a process on a remote system, and
it
> > works great as long as the path to my executable resides on the same
remote
> > system.

> > If  I specifiy a network path for my executable, either through UNC or
> > mapped drive letter it fails with an access denied message.  I've also
tried
> > specifying numerous privileges in the GetObject command with no luck.

> > Does anybody know if there is a way around this, or is it a limitation
of
> > the win32_process.create method.

> Hi

> I forgot about one other workaround that might apply to you:

> If you want to do a remote installation that is unattended (no user input)
and
> single file install file based, you can use PsExec.exe in the free PsTools
suite

> from Sysinternals for this (will work on Win NT 4.0, Win2k and WinXP).

> http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

> To install e.g. q323759.exe remotely, do like this:

> psexec.exe \\some_computer  -c C:\q323759.exe /q:a /r:n

> The file "behind" -c must exist on the computer running PsExec.
> PsExec will copy the specified program to the remote system for execution
and
> run it with the additional switches. After the install, the file
q323759.exe
> will be deleted from the remote computer.

> If not domain, username and password can be supplied:
> psexec.exe \\some_computer -u user -p pwd -c C:\q323759.exe /q:a /r:n

> See here for a complete VBScript example that installs SW on a list of
computers

> in a text file using PsExec:


> Subject: Re: Auto-Installing WMI
> Newsgroups: microsoft.public.win32.programmer.wmi
> Date: 2002-08-12 20:04:56 PST

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=3D58758B.3139...
hydro.com

Quote:

> --
> torgeir
> Microsoft MVP Scripting and WMI
> Porsgrunn Norway

 Torgeir,

It turns out changing the Authentication  to kerberos did not have an
effect.  I'm assuming this is probably a security feature MS added to help
control a worm type virus.  I can still schedule the task to occur.  Thanks
for the great suggestions.

Droid



Fri, 25 Mar 2005 02:05:05 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Start a program or process in Remote PC?

2. Starting a Remote Process

3. Starting process on remote computer

4. Starting a process on remote machine

5. Starting process on remote computer

6. Process ID's from a remote system

7. How to terminate a process on a remote system

8. System.Diagnostics.Process.Start("C:\")

9. Starting a process via the system clock

10. Starting a background process on an NT server?

11. Starting processes on reomte machienes

12. Start Process under different user (with WMI)

 

 
Powered by phpBB® Forum Software