Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute command with ASP 1

Status
Not open for further replies.

tvbruwae

Programmer
Aug 9, 2001
224
EU
Hi

On one of our intranet pages I would like to have a button that can trigger an application on the webserver. For example, when someone clicks that button a batch file should run on the server.

Is there a way to do this in ASP? I.e. can you write ASP code that runs commands on the Windows machine itself (without having to send anything to the client)?

Best regards,
Tim
 
use WSH
sample code:
Code:
<%
Dim WshShell
Set WshShell = Server.CreateObject("WScript.Shell")
WshShell.Run "notepad.exe"
Set WshShell = Nothing
%>

google for more related stuff...

hope this helps

-DNG
 
Be careful not to launch any program that requires user interaction to close because it won't appear on the desktop and you'll need to kill it with the task manager.
 
Posted at the same time ;-)

The script works. It runs a batch file containing some SQL Server export commands, so basically it does not impose security risks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top