Solved

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

Posted on 2004-09-13
3
439 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

705 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