Re: Please help. Run batch file on server from asp.net page
From: Paul (paulsmith5_at_hotmail.com)
Date: 03/12/04
- Next message: Steve C. Orr [MVP, MCSD]: "Re: Advantage of data set"
- Previous message: Steve C. Orr [MVP, MCSD]: "Re: Securing access to other files in an ASP.NET application"
- In reply to: Dennis Homann: "Re: Please help. Run batch file on server from asp.net page"
- Next in thread: Dennis Homann: "Re: Please help. Run batch file on server from asp.net page"
- Messages sorted by: [ date ] [ thread ]
Date: 12 Mar 2004 01:37:46 -0800
Hi Dennis,
Thanks for the reply. I haven't tried that exact combination. I'll
give it a go but I think its something else.
"Dennis Homann" <anonymous@discussions> wrote in message news:<u$kFSN2BEHA.2600@TK2MSFTNGP09.phx.gbl>...
> Hi Paul,
>
> have you tried to set your filename to
>
> ProcessStartInfo.FileName = "cmd C:\Inetpub\wwwroot\myapp\do.bat"
>
> I'm not sure, if this will solve your problem, but it should be worth a try.
>
> Regards,
> Dennis
>
> "Paul" <paulsmith5@hotmail.com> schrieb im Newsbeitrag
> news:ca236fb1.0403110143.6ded553e@posting.google.com...
> > Hi,
> >
> > I'm trying to add a button to an asp.net page that when clicked will
> > run a batch file on the server. My code which gets executed on the
> > click event of my button is as follows
> >
> > Dim ProcessStartInfo As New System.Diagnostics.ProcessStartInfo()
> > ProcessStartInfo.FileName = "C:\Inetpub\wwwroot\myapp\do.bat"
> > ProcessStartInfo.WorkingDirectory = "C:\Inetpub\wwwroot\myapp\"
> > ProcessStartInfo.UseShellExecute = True
> > ProcessStartInfo.CreateNoWindow = True
> > System.Diagnostics.Process.Start(ProcessStartInfo)
> >
> > The batch file unzips a file which is located in the working directory
> > into the same directory. The executable that is called by the batch
> > file (which does the unzipping) is also in this directory. I've tested
> > my batch file by running it in a DOS window and it does what is
> > expected. However when I execute the code from the asp.net page
> > nothing works but I don't get an error. (I know that the code is
> > getting executed because I have stepped through it and when I change
> > the FileName property to a fictitious value I get an error). I've
> > tried various combinations of the above i.e. trying to running cmd.exe
> > passing in the bat file name as ProcessStartInfo.Arguments value,
> > setting various values for the ProcessStartInfo.WindowStyle etc. I've
> > given aspnet_wp account full control permissions on all directories I
> > think may be necessary (e.g. the working directory above, my windows
> > installation directory when I tried calling cmd.exe etc.). I'm still
> > sure it has something to do with permissions. If somebody could help
> > me out I'd be grateful. I know that executing something on the server
> > is not a good idea and believe me when I say this is not my preferred
> > approach but I just want to get it working at this stage.
> >
> > Thanks,
> >
> > Paul
- Next message: Steve C. Orr [MVP, MCSD]: "Re: Advantage of data set"
- Previous message: Steve C. Orr [MVP, MCSD]: "Re: Securing access to other files in an ASP.NET application"
- In reply to: Dennis Homann: "Re: Please help. Run batch file on server from asp.net page"
- Next in thread: Dennis Homann: "Re: Please help. Run batch file on server from asp.net page"
- Messages sorted by: [ date ] [ thread ]