This is how to make ASPEXEC, WSH work thru ASP
Objective to use an ASP page to run a remote application (exe file) on a web server with ASPEXEC.
----------------------------------------------------------
-ASPEXEC executes remote applications as DOS Apps or Windows Applications.
This is how we do it ..:)
REGISTER ASPEXEC
1)move file aspexec.dll to winnt/system32 directory
2)regsrv32 aspexec.dll
***ASPEXEC DOS Commands can sometimes not work properly if Norton antivirus "Script Blocking is enabled, only Windows commands will work smoothly!
***Remote application will not pop up window, whether you use DOS or windows commands, due to SP3 service pack bug.
***IF REMOTE APP IS OPEN , then use terminate on XP, or kill on 2000 Server first!! Otherwise will not work.
SERVICES
1)World Wide Web Publishing--> Allow Service To Interact With Desktop (checked)
IIS
1) Create virtual directory
-Scripts Only
-LOW IIS Process
-Anonymous Login /Windows Integration (checked)
ASP PAGE, WEB FOLDER PERMISSIONS
Example: c:\Inetpub\wwwroot\virtualdirectory\myasppages
For DOS all you need :
Administrator -full control
Everyone-full control
For Windows add these too
Internet Guest Account(MACHINENAME/IUSR_MACHINENAME)-Read & Execute,Read,List
REMOTE APPLICATION EXE FOLDER SECURITY/PERMISSIONS
Administrator -full control
Everyone-Read & Execute,Read,List
ASP PAGE, excuting as Windows App.
<%@ Language=VBScript %>
<%Option Explicit %>
<%
dim Executor,strResult,WaitObj
Response.Buffer = true
Executor.Application = """C:\Program Files\remoteapp\remoteapp.exe""/ARGUMENTS"
Executor.ShowWindow = false
Set Executor = Server.CreateObject("ASPExec.Execute")
Response.Write "Attempting to execute " & Executor.Application & "<br>"
strResult = Executor.ExecuteWinApp
Response.Write "done"
set Executor=nothing
%>
ASP PAGE, excuting as DOS App.
<%@ Language=VBScript %>
<%Option Explicit %>
<%
'DOESNT WORK WITH SCRIPT BLOCKING ENABLED
dim oShell,tmpStr,oExec,RetCode,sExecStr
sExecStr"""C:\Program Files\remoteapp\remoteapp.exe""/ARGUMENTS"
Set oShell = Server.CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sExecStr)
set oShell=nothing
set oExec=nothing
|