Discussion Locked

Execute DOS batch file from ASP?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is it possible to call or execute a DOS batch file command within an ASP page!?
Is there a system call property or Object!?

Appreciate your feedback!
Thank you!

5 replies

by peter ritchie

There's no default way to execute a BAT file from an ASP script (or VBScript/JScript script for that matter).

You'd have to write--or find--and object that performed this for you that you could simply call from your ASP script.

If you don't care where the BAT file is run you can setup IIS so that BAT files are run like CGI applications. But, that would be completely separate from ASP.

by beermonster

I've never tried embedding this vbscript in an asp page, but I don't see why it shouldn't work...
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("cmd /c myscript.cmd")
Set WshShell = nothing

Hope it goes OK...

This discussion is closed to new replies.