What I am trying to do is run a batch file that is located on the webserver's desktop when a button is clicked. This is what I have thus far.
ProcessStartInfo psi = new ProcessStartInfo("Notepad.exe");
psi.WorkingDirectory = @"C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories";
psi.UseShellExecute = false;
psi.UserName = "administrator"; //username
psi.Password = secure; //secure string
var process = Process.Start(psi);
When I debug it, it does exactly what I want it to, but when I access the site on IIS (localhost:81) the batch file never runs. I've tried many different variants of ProcessStartInfo and Process with no luck. I've tested the username and password and they are both correct too.
I don't get any errors, the button just triggers a page post back.
I have given IUSR and IIS_IUSRS permissions to the file, and still nothing runs. I also removed the username and password and set the UseShellExecute to true, but that did nothing as well.
EDIT:
It looks like everyone thinks its some permissions. Any idea on what I need to do to allow IIS to open the process?
Thanks in advance!