Solved

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

Posted on 2004-09-13
3
418 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
Comment Utility
0
 

Author Comment

by:parvinderg
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

9 Experts available now in Live!

Get 1:1 Help Now