Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to call a remote console application from an ASP.NET C# web application?

Posted on 2004-09-13
3
429 Views
Last Modified: 2008-02-01
Hello folks,

The following code snippet causes an exception "Logon failure: unknown user name or bad password".

     Process p = new Process();
     p.StartInfo.UseShellExecute = false; // only executables; no docs like Run.
     p.StartInfo.RedirectStandardOutput = true;
     p.StartInfo.Arguments = @"www.yahoo.com";
     p.StartInfo.FileName = @"\\my-remote-machine-name\C$\WINDOWS\SYSTEM32\ping.exe";
     //p.StartInfo.FileName = "C:\\WINNT\\SYSTEM32\\ping.exe";
     p.StartInfo.CreateNoWindow = true;
     p.Start();
     string output = p.StandardOutput.ReadToEnd();
     p.WaitForExit();

To use shared folders in that remote machine, I supply my credentials.
How do I pass that user name and password for the above code to work?

Your help will be highly appreciated.

Thank you,
Parvinder
0
Comment
Question by:parvinderg
  • 2
3 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12046670
0
 

Author Comment

by:parvinderg
ID: 12058055
Thank you, that worked.

I added ASPNET as username and a cleartext password in machine.config.
Also I created ASPNET user on the remote machine.

I'm not sure if cleartext password in machine.config is safe.
And what privilages should the ASPNET account on the remote machine have?

PSG
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 500 total points
ID: 12064964
I am afraid that I can't really help you with these supplemental questions as I am just learning .Net now. Perhaps you might ask these in the ASP.Net topic area?

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/

Perhaps someone there can help.

Good luck,

FtB
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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