I have a batch file to execute a VB script. Although double-clicking the batch file will work, but when I did the same with C #, it worked in my local environment, but not on the intermediate server (Windows 2008r2 server). Is there any permission level that I need to apply for this execution? From an intermediate server I can double click and execute the batch file ...
I logged in to the server with an administrator account and viewed the application as localhost.
Is there something that I am missing when executing a batch file with C #,
I donβt think there are any problems with my C # code, since it works fine in my local environment, anyway, this is my C # code,
if (File.Exists(FileName*)) { System.Diagnostics.ProcessStartInfo p = new System.Diagnostics.ProcessStartInfo(FileName); System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = FileName; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.UseShellExecute = false; proc.Start(); proc.WaitForExit(); } else { lblMsg.Text = "Sorry unable to process you request"; }
* FileName is the path to the batch file. In addition, I set full permission to folders that contain batch and vbs files.
sudheshna
source share