Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting a program to execute on the server in IIS with c#
    primarykey
    data
    text
    <p>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. </p> <p>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.</p> <p>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:</p> <pre><code>//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); } } </code></pre> <p>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 <a href="http://msdn.microsoft.com/en-us/library/xh507fc5%28v=vs.100%29.aspx" rel="nofollow noreferrer">impersonation</a>, changing the permissions on the folder that the script was in and <a href="https://stackoverflow.com/questions/8414514/iis7-does-not-start-my-exe-file-by-process-start">changing the permission of the folder the scripts are in to include the IIS user </a> and nothing has worked. </p> <p>Why isn't this working?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload