using "runas" dos command from a webapp
I am trying to use a webapp to start a batch file, but I have several
problems. When the webapp starts the file, it uses the ASPNET user name,
which doesnt have permissions on the network to reach mapped drives that the
batch file uses. As a result, I want to run the batch file with the "runas"
dos command, which requires the password for the new user. If I pipe that
password right into the command, I get an error, "RUNAS ERROR: unable to
change echo mode".
One solution I know of is to use a shell, like VB's WSH shell, to input the
password after the runas command begins. Or, maybe there is a way to tell
VS6 .NET to start the process with a different user. I use the
System.Diagnostics.Process class, I've tried using cmd.exe as the file
with runas and it's parameters as the process parameters, and I've tried
using runas.exe as the file and just it's parameters as the process
Another solution would be to find a way to prompt the user for their
password, but I dont see how I can prompt the user (a client on the LAN), to
put a password directly into a command shell on the server.
I would greatly appreciate any advice anyone can offer.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL