Solved

how to call batch file from asp

Posted on 2001-08-07
3
619 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Silvers5 earned 50 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:Silvers5
ID: 6362616
Yes it is..
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 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