Print Page | Close Window

run an exe file on the server

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6245
Printed Date: 31 March 2026 at 6:31am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: run an exe file on the server
Posted By: sonda
Subject: run an exe file on the server
Date Posted: 07 October 2003 at 10:13pm

I downloaded ASPExec 3.0 from http://www.serverobjects.com./ - http://www.serverobjects.com. It
is supposed to allows you to execute DOS and Windows apps.
I moved the DLL in the subdirectory \winnt\system32 and I typed regsvr32
aspexec.dll

I went into control panel/services/world wide web publishing service and turn "Allow Service to Interact with Desktop" on.
I execute the program :
The results :

Attempting to execute notepad.exe
The result of this call was : Ok

I see Notepad in the taskmanager but it does not appear on my desktop.

Did i do something incorrectly?

code:

<%
  Set Executor = Server.CreateObject("ASPExec.Execute")
  Executor.Application = "notepad.exe"
  Executor.Parameters = "c:\autoexec.bat"
  Executor.ShowWindow = True
  Response.Write "Attempting to execute " & Executor.Application & "<br>"
  strResult = Executor.ExecuteWinApp
  Response.Write "The result of this call was: " & strResult
%>

I wait for your advices,

Thank so much!




Replies:
Posted By: Coco Brown
Date Posted: 09 October 2003 at 2:11pm

I did this with the shell command in a commandline environment.  I didn't try this out with a webserver, but you could give it a shot.

set wShell = server.createObject(wScript.shell)
wShell.run("%comspec% /c run notepad.exe ")

...you need to preface the DOS command with "%comspec% /c"

The server creates an instance of the wscript shell object. It then sends an environmental variable to command.exe.  The DOS command is "run notepad.exe" .You will probably have to put the path in front of notepad.exe however.

I hope this helps.     




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net