how to call batch file from asp

hello-

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

thanks - p
pipeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Michel SakrConnect With a Mentor Commented:
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
 
pipeAuthor Commented:
thanks. do you know if the windows scripting host is installed by default on nt4 and w2k?
0
 
Michel SakrCommented:
Yes it is..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.