Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
It would be useful if I can put some commands inside my 'private use' webpage to ask the server to start a to run a program for example, a compress program to backup the file.

In Linux, one ofen see implementation which starts another shell (sh command) to run another program from where ever you are. For example, inside vi editor, you can type !ls to list a directory.

Can we do similar thing inside ASP program in window 2003 server environment - click a button and the server will start to do as asked?

rgds,
kfl.
Posted

1 solution

If you're talking about classic ASP, you can use something like this:

<![CDATA[<% 
    set wshell = CreateObject("WScript.Shell") 
    wshell.run "myProgram.exe" 
    set wshell = nothing 
%>]]> 


If it's ASP.NET, you can use something like this:

using System.Diagnostics;
...
Process process = new Process
{
     StartInfo = new ProcessStartInfo("myProgram.exe")
};

process.Start();


I hope this helps!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900