Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to call batch file from asp

Posted on 2001-08-07
3
Medium Priority
?
621 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:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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 was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

670 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