can ASP execute command line args?
Maybe. It depends on the security settings of the IIS server (or the client if you want to execute there.)
On IIS 5 you could execute wscript.shell commands. On IIS 6 you need to assign a user for the subweb and give that user permissions to execute wscript and cmd.exe. Obvioulsy (or maybe not so) if a remote user can upload a malicious script and execute it under that context the attacker can own your server.
e.g. It is doable but much caution is needed.
Server example: (run a ping piping the results to a file the open the file and echo results to the web page)
<%
Dim objFSO, objShell, objTempFile, objTextFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
objName = objFSO.GetTempName
objTempFile = objName
objShell.Run "cmd /c ping -n 3 -w 1000 64.126.4.193 >" & _
objTempFile, 0, True
Set objTextFile = objFSO.OpenTextFile(objTempFile, 1)
Do While objTextFile.AtEndOfStream <> True
strText = objTextFile.ReadLine
If Instr(strText, "Reply") > 0 Then
response.write "Reply received."
End If
Loop
objTextFile.Close
objFSO.DeleteFile(objTempFile)
%>
Client example:
http://www.rodsdot.com/ee/runClientSideExecutable.asp (IE/Win only)