Starting process on remote computer 
Author Message
 Starting process on remote computer

I need to start a EXE on a remote computer using VB. The remote system could
be Win9x or a flavor of NT. If NT, it would be a NT box where I am admin. I
have searched the NGs for information on how to do this. There are numerous
requests from folks who need this capability but no replies really offer a
clear solution. For doing something seemingly simple it certainly appears
much work must be done to implement it.

Has anyone come across a simple clear solution for this yet? Something that
does not require writing to sockets or installing services on both
computers. Possibly a high level API as a wrapper for this functionality?
What is the easiest way to achieve this with the least amount of trouble?

JR



Tue, 02 Mar 2004 13:36:35 GMT  
 Starting process on remote computer
Try this....

Private Sub cmdOK_Click()
'Run exe on remote NT computer
'Requires project reference to "Window WMI Scripting Library"
'Requires Domain Name in Me.txtDomain and PC Name in Me.txtWSName on parent
form
Dim MyProc As WbemScripting.SWbemObject
Dim MyMethod As WbemScripting.SWbemMethod
Dim inParam As SWbemObject
Dim outParam As SWbemObject
Dim FName As String
Dim result As Variant
On Error GoTo 0
VncStartSuccess = False
Me.MousePointer = vbHourglass
FName = "WinMgmts:{impersonationLevel=impersonate,authority=ntlmdomain:" &
Trim$(Me.txtDomain) & "}!//" & Me.txtWsName & "/root/cimv2:Win32_Process"
On Error GoTo NoServer

Set MyProc = GetObject(FName)

Set MyMethod = MyProc.Methods_("Create")
Set inParam = MyMethod.InParameters.SpawnInstance_()
inParam.CommandLine = "calc.exe"
Set outParam = MyProc.ExecMethod_("Create", inParam)

Me.MousePointer = vbDefault
Set MyProc = Nothing
Me.Hide
Exit Sub

NoServer:
Me.MousePointer = vbDefault
MsgBox ("Startup error")
Set MyProc = Nothing
Me.Hide
End Sub


Quote:
> I need to start a EXE on a remote computer using VB. The remote system
could
> be Win9x or a flavor of NT. If NT, it would be a NT box where I am admin.
I
> have searched the NGs for information on how to do this. There are
numerous
> requests from folks who need this capability but no replies really offer a
> clear solution. For doing something seemingly simple it certainly appears
> much work must be done to implement it.

> Has anyone come across a simple clear solution for this yet? Something
that
> does not require writing to sockets or installing services on both
> computers. Possibly a high level API as a wrapper for this functionality?
> What is the easiest way to achieve this with the least amount of trouble?

> JR



Tue, 02 Mar 2004 15:23:45 GMT  
 Starting process on remote computer
Jerry, I believe DCOM is probably the technology to use, but I'm
afraid I've no idea how you do it. (And I call myself a professional!)
See what MSDN (Online) can tell you about it.


Tue, 02 Mar 2004 17:51:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Starting process on remote computer

2. Getting the process Ids of a remote computer

3. Starting applications on a remote computer

4. Starting applications on a remote computer

5. use vbscript to start application at remote computer

6. starting DCOM-server on a Remote-computer using VISIO-VBA

7. Starting applications on a remote computer

8. Starting applications on a remote computer

9. starting nt service on remote computer

10. Starting a Process on a Remote System

11. Starting a process on remote machine

12. Get computer name and IP from remote computer

 

 
Powered by phpBB® Forum Software