Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Executing a .bat file from ASP.Net VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnP - 25 Sep 2007 20:31 GMT
I am trying to execute a .bat file with the following code:

Dim objProcess As Diagnostics.Process
       Dim objProcessInfo As Diagnostics.ProcessStartInfo

       objProcess = New Diagnostics.Process()
       objProcessInfo = New Diagnostics.ProcessStartInfo(Server.MapPath("COFile.bat"))

       objProcess.StartInfo = objProcessInfo
       objProcess.EnableRaisingEvents = True
       objProcess.Start()
       objProcess.WaitForExit()

It doesn't seem to be doing anything.  Am I doing something wrong with the code?

Thanks.

John
John Timney (MVP) - 25 Sep 2007 21:11 GMT
Check your task manager on the server.  It may be starting but unable to
execute what the batch file actually contains.  You can't always start some
processes from the asp.net account.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog

>I am trying to execute a .bat file with the following code:
>
[quoted text clipped - 16 lines]
>
> John
Alexey Smirnov - 25 Sep 2007 21:27 GMT
> It doesn't seem to be doing anything.

Create a log file in your .bat, to see if it executed or not
Hans Kesting - 26 Sep 2007 09:31 GMT
> I am trying to execute a .bat file with the following code:
>
[quoted text clipped - 13 lines]
>
> John

Where do you expect that batch file to be executed? How do you
expect to see the results?
That batch file will run on the server, probably using the
"NETWORK SERVICE" account. Any output will not be show to the
user accessing the page that fired this command.

Hans Kesting

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.