Start.Process on remote system.

I am a long time IBM programmer, with a few years now of .net experience, so please forgive me if I get crossed up in terminology a bit;

We have a webserver, system 'A' and an application server, system 'B'.

A webapp on 'A' needs to run/trigger/call a vb.net console application on 'B'.

No problem there,  I've been using System.Process, which works quite well except that I recently discovered that when using this technique, the application is actually executing on 'A', not 'B'.

The application server 'B' is a much more powerful system than the webserver 'A'. I want to use the resources of 'B' to execute the app. I haven't been able to find an overload of  system.process.start that specifies which system to execute the app on.

Thanks for your help.
ordoAsked:
Who is Participating?
 
SStoryConnect With a Mentor Commented:
Abolutely.
Check out system.diagnostics.process
create a ProcessInfo object with the appropriate args for psexec.

dim psi as new ProcessInfo(
dim p as process
p=process.start(psi)

I'm not sure how well this will work on a webserver, but you can launch a command-line process from a vb.net app.

Here's a vb.net way that claims to work:

http://codesnippts.blogspot.com/2010/07/start-process-on-remote-machine.html
0
 
SStoryCommented:
This will do it for you.

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Not sure it will help from a webservice
0
 
ordoAuthor Commented:
SStory ,

Thank you very much for your response.

I did look at PsExec, but unless I'm mistaken, it is a command-line tool. Can it be used in a vb.net program?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ordoAuthor Commented:
I probably should have specified this in my original question, but the webapp 'A' should not have to wait for the process/application on 'B' to complete. Similar to the  -d used in PsExec.
0
 
ordoAuthor Commented:
SStory,

Thanks for your help. Here's what I worked out;

  Dim startInfo As New ProcessStartInfo()
        startInfo.WindowStyle = ProcessWindowStyle.Hidden
        startInfo.CreateNoWindow = True
        startInfo.FileName = "c:\psexec"
        startInfo.UseShellExecute = False
        startInfo.LoadUserProfile = True
        startInfo.Arguments = "\\remote-system-name   folder-path-to-remote-program"

        Process.Start(startInfo)

Works like a charm.
0
 
SStoryCommented:
cool!
0
All Courses

From novice to tech pro — start learning today.