0

I have a bat file that runs a vb script i want to execute the bat file from asp when i run asp application from visual studio it runs fine but when i deploy my application on iis page keep on loading and vb script is not executing I am using the following code

Procesa proc = new process();
String path =[path to bat file]
proc.StartInfo=new ProcessStartInfo(path);
proc.startInfo.WorkingDirectory= [path to dir]
proc.StartInfo.CreateNoWindow=false;
proc.StartInfo.UserShellExecute=false;
proc.Start();
proc.WaitForExit();
  • Please [edit] the question and include the code that you use to call the .bat file. – Peter B Jul 12 '19 at 07:39
  • For /f "delims" %%i IN ('DIR *.xlsx /d') DO excel.vbs "%%i" "%%i.csv" i am converting all xlsx to cvs in vbs – Hamzaa Asif Jul 12 '19 at 07:46
  • 1
    (1) Please **[edit]** the question, do not put additions in comments (2) That is not how you **call** the .bat file, it is what's inside it (which is at the moment secondary) – Peter B Jul 12 '19 at 07:50
  • I have added the code in my post – Hamzaa Asif Jul 12 '19 at 09:56
  • See this answer: https://stackoverflow.com/a/8414869/1220550 **Note however** that the advice given there (giving the IIS process "Full Control") is a potential security disaster waiting to happen: a hacker that finds a hole in your application (or in IIS itself) can do **anything** on the machine because then also they have Full Control. There are alternatives, but no easy ones, e.g. creating a Windows Service that does this, which is resident in memory on the Webserver and waiting to be triggered through a service call by your website. – Peter B Jul 12 '19 at 10:52
  • Still i am stuck on page load and nothing happens – Hamzaa Asif Jul 12 '19 at 11:06

0 Answers0