Remote execute an application(executable).
-
Is it possable in VB.NET to execute an application on a remote machine over the internet so that the application opens (executes) on that specific web server. For examle: "c:\windows\system32\notepad.exe c:\file.txt" this should then open file.txt in notepad on the remote machine. I suppose this should be a SOAP, XML function.
-
Is it possable in VB.NET to execute an application on a remote machine over the internet so that the application opens (executes) on that specific web server. For examle: "c:\windows\system32\notepad.exe c:\file.txt" this should then open file.txt in notepad on the remote machine. I suppose this should be a SOAP, XML function.
not sure about vb.net, but this should still work. Search the WMI stuff relating to remote launching, you basically connect to the server(remote machine), then tell it to create a process. I've written a component to do this in C++, but the reason for that is I'm using a Dialup connection to connect to 380 machines, and I need other operations to continue whilst the WMI connection starts(in a thread). If you don't have these issues, there are lots of WMI examples in MSDN for doing this. This is a function I've used previously.
Function LaunchRemoteProgram(program As String, Optional user As String = "", Optional pass As String = "", Optional servername As String = ".") As Integer Dim objLocator As WbemScripting.SWbemLocator Dim objService As WbemScripting.SWbemServices Dim objInstance As WbemScripting.SWbemObject Set objLocator = New WbemScripting.SWbemLocator On Error Resume Next If servername = "." Then Set objService = objLocator.ConnectServer(".", "root\cimv2") Else Set objService = objLocator.ConnectServer(servername, "root\cimv2", user, pass) End If If Err.Number Then ' LaunchRemoteProgram = Err.Number Else Set objInstance = objService.Get("Win32_Process") objInstance.Security_.AuthenticationLevel = wbemAuthenticationLevelConnect objInstance.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate objInstance.Create program, Null, Null, LaunchRemoteProgram End If End Function
Hi this is of use to you.