Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to call batch file from asp

Posted on 2001-08-07
3
Medium Priority
?
622 Views
Last Modified: 2011-09-20
hello-

how can i call a batch file that is in the same dir as my asp?

thanks - p
0
Comment
Question by:pipe
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Michel Sakr earned 200 total points
ID: 6359752
How do I execute a DOS command / batch file / exe from ASP?

You can use ASPExec from http://www.serverobjects.com/. Alternatively, if you have Windows Script Host installed, you can do this (sorry, I've only had the time to test .bat files):
 
<%
    set wshell = server.createobject("wscript.shell")
    wshell.run "c:\file.bat"
    set wshell = nothing
%>
 
 
Where c:\file.bat is something like:
 
    net stop iisadmin /y
    net start w3svc
 
 
 
OR
 
    attrib c:\boot.ini -h -r -s -a
 

0
 

Author Comment

by:pipe
ID: 6359934
thanks. do you know if the windows scripting host is installed by default on nt4 and w2k?
0
 
LVL 20

Expert Comment

by:Michel Sakr
ID: 6362616
Yes it is..
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question