I'm building a project that will allow a user to upload a video to the server and the server will encode the video in certain formats. Once the upload is done, a vbs script should execute to do the things I need it to do.
I'm having a really difficult time with getting the script to run on the server, though. When debugging in VS2012 on the server itself, I can get this to work fine. However, when I deploy it and run the same code, it doesn't work.
I tried taking a step back and I'm attempting to get ANY program to execute, but it's not working. Here is my code that I'm running to try and open notepad after a file is uploaded:
//file is saved
try
{
ProcessStartInfo psi = new ProcessStartInfo(@"C:\Windows\System32\notepad.exe");
Process proc = new Process();
proc.StartInfo = psi;
proc.StartInfo.FileName = @"C:\Windows\System32\notepad.exe";
bool didItStart = proc.Start();
}
catch(Exception ex)
{
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\test\log.txt"))
{
file.WriteLine(ex.InnerException + " " + ex);
}
}
This doesn't throw any errors, nothing is written to the log file. Nothing happens. I've been googling for a while and have found and tried a bunch of things which haven't worked, including impersonation, changing the permissions on the folder that the script was in and changing the permission of the folder the scripts are in to include the IIS user and nothing has worked.
Why isn't this working?