We help IT Professionals succeed at work.

execute msdos command line by asp

hwwong
hwwong asked
on
is it possible to use asp code to execute a MSDOS command line or run a batch file? I want to make a button in my asp page which can execute a command line when it is clicked.
Comment
Watch Question

CERTIFIED EXPERT
Commented:
You can use WScript
Example to run the notepad,
<%
dim wsh
set wsh = server.createobject("WScript.Shell")
wsh.run("C:\windows\notepad.exe")
set wsh = nothing
%>

Or use AspExec component. Download it at http://www.serverobjects.com/products.htm


hongjun
CERTIFIED EXPERT

Commented:
Any feedback?

hongjun

Author

Commented:
Sorry for being late to give the feedback. The script hongjun provided works for me. Thanks.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.