Solved

how to call batch file from asp

Posted on 2001-08-07
3
614 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:
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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