Start.Process on remote system.

Posted on 2012-09-07
Last Modified: 2012-09-11
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 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.
Question by:ordo
    LVL 25

    Expert Comment

    This will do it for you.

    Not sure it will help from a webservice

    Author Comment

    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 program?

    Author Comment

    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.
    LVL 25

    Accepted Solution

    Check out system.diagnostics.process
    create a ProcessInfo object with the appropriate args for psexec.

    dim psi as new ProcessInfo(
    dim p as process

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

    Here's a way that claims to work:

    Author Closing Comment


    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"


    Works like a charm.
    LVL 25

    Expert Comment


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now