rtaiss

Do u know pls why this code doesn't execute my batchFile.exe what am I missing

Thank you

System.Diagnostics.Process p=new System.Diagnostics.Process();
p.StartInfo.WindowStyle=ProcessWindowStyle.Maximized;
p.StartInfo.FileName=@"c:\dev\myFolder\myBatchFile.exe";
p.StartInfo.UseShellExecute = false;
p.Start();
p.WaitForExit();

Thank you



Re: Visual C# General myprocess.Start() is not working for me in .net 2003

Z.Y.S.

Hi
I have just tried to run in it on my VS.Net2003 and it worked. Of course using different name in FileName.

So probably you should try running another program in your process (I used "calc.exe") to see if it will work.
Can you run "myBatchFile.exe" from your console, or windows explorer does it run properly
By reducing the problem to small step, I guess you will be able to uncover the reason of the problem.

Regards





Re: Visual C# General myprocess.Start() is not working for me in .net 2003

Bulldog.NET

Hi,

please post the error you are getting when you run the code.






Re: Visual C# General myprocess.Start() is not working for me in .net 2003

rtaiss

weird, I can't even execute:
System.Diagnostics.Process.Start("Notepad.exe");
And i can t debug, it says i have no permission to debug




Re: Visual C# General myprocess.Start() is not working for me in .net 2003

Bulldog.NET

Hi

Are you developing in ASP.net or Windows Application






Re: Visual C# General myprocess.Start() is not working for me in .net 2003

rtaiss

in asp.net.

i thought it didn t make difference

Thank you





Re: Visual C# General myprocess.Start() is not working for me in .net 2003

Sean Hederman

ASP.NET runs under a restricted user account. It is generally regarded as a very bad thing to allow your web server to execute applications on your machine. You could increase the permissions for the ASP.NET user account, but I'd strongly recommend you find another way to acheive your desired result. What does the application you're trying to run do exactly






Re: Visual C# General myprocess.Start() is not working for me in .net 2003

rtaiss

it uploads and downloads some files from and to ftp server. I mean all am trying to do is execute a .bet file that executes a .exe by iteslf

or may be impersonnation will help, m not sure

Thank you





Re: Visual C# General myprocess.Start() is not working for me in .net 2003

Bulldog.NET

Hi

To impersonate just include this following code in the web.cofing file inside <system.web>


<system.web>
<identity impersonate="true" userName="username" password="password"/>
</system.web>

Hope this helps.






Re: Visual C# General myprocess.Start() is not working for me in .net 2003

Ernst Kuschke

I suggest you move the FTP functionality into a DLL that your aspnet app calls directly.





Re: Visual C# General myprocess.Start() is not working for me in .net 2003

rtaiss

men, thanks a lot for the advices, veru precious. my code worked on the target server, may it s just that i had a pb in my local windows 2003 virtual machine, but it worked.

i ll keep the advices in mine: web.config and the dll ideas thanks a lot