Running An .EXE in ASP "Windows Server 2003"

This used to work on XP, it doesnt work on Windows Server 2003

Page :

Page = "Start Services"
Header = "Start Cygnus IRC Services"

Dim Action
Action = "Cygnus Was <font color=red>Started</font>"
<!-- #INCLUDE FILE="../Includes/Header.asp" -->
<!-- #INCLUDE FILE="../Includes/Admin.asp" -->
<!-- #INCLUDE FILE="../Includes/Add_Action.asp" -->
Dim WSHShell
Set WSHShell = Server.CreateObject("WScript.Shell")
WSHShell.Run """C:\Progra~1\Cygnus~1\Start.lnk"" START" ,1,true
Set WSHShell = Nothing
Services Should Now Be <b>Starting</b>
<!-- #INCLUDE FILE="../Includes/Footer.asp" -->"

Error :

ASP 500 Error
An error occurred processing the page you requested.
Please see the details below for more information.

COM Error Number -2146828281 (0x800A0007)
File Name /IRC/Admin/Cygnus/Start.asp
Line Number 16
Brief Description Out of memory

The worker process is running in my credentials (I allowed it to) but the problem still persists... I have added an extra 64mb Of RAM to the computer actually believing the error...but no still the same..
Who is Participating?
I know there's no update for windows scripting - it's all different in Windows 2003.  Unfortunately, you'll never be able to run everything the same way you did on 2000.  I've had the same problem, and we spent weeks trying to get it to run without dot net.  In 2003, they changed the way services executed from the web account run.  Trust me, read all about it.

The good news?  Classic asp works great on dot net - no problem there.  But forget about windows scripting, Microsoft has changed the way it runs.

Also, read more about dot net - in a web environment, there is NO client-side install - you do not need a Redistributable package.  ASP.NET is just the new ASP - works exactly the same way ASP did as far as it runs on the server with no client download, with some improvements (and some disadvantages).

Trust me, you can spend weeks researching this like we did, or just accept the fact that Microsoft is trying to pigeon-hole you into upgrading.  ASP is no longer supported, and they are pushing dot net.
Try to run notepad instead, and see if it works.  Problem may be with the .lnk file
You have to use VB.NET on Windows 2003 Now:

<%@ page language="vb" %>
<%@ import namespace="System.IO" %>
<%@ import namespace="System.Diagnostics" %>

<script language="vb" runat="server" >

Public Sub page_load(s as object,e as eventargs)
      '### START PROCESS
      Dim myProcess As Process = New Process
      myProcess.StartInfo.FileName = "C:\Windows\notepad.exe"
      myProcess.StartInfo.Arguments = "myfile.txt"

      myProcess.StartInfo.UseShellExecute = False
      myProcess.StartInfo.CreateNoWindow = False
      myProcess.StartInfo.RedirectStandardError = True
      myProcess.StartInfo.RedirectStandardOutput = True

      Dim sOut As StreamReader = myProcess.StandardOutput
      Dim outStr As String = sOut.ReadToEnd()
      Response.Write("<h4>OUTPUT: " & outStr & "</h4>")
      '### READ STD ERR
      Dim sErr As StreamReader = myProcess.StandardError
      Dim outErr As String = sErr.ReadToEnd()
      Response.Write("<h4>ERROR: " & outErr & "</h4>")

End Sub


Call this script exe.aspx and run it via your browser.  It will appear to do nothing - but look in your task manager for notepad.exe, you'll see it in there running under Network Service.  Close it, and this aspx file will end.  I'm not sure what you want to do with your EXE file, but if it closes itself, this will be the script for you.

If you need to close the running EXE from the file, you can use myProcess.Close() instead of myProcess.WaitForExit() after the program has done whatever it needs to do.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

matthew1471Author Commented:
My Cygnus stays running for the entire duration of the computer being on (Untill I run Cygnus_stop.asp) it runs IRC Services for Unreal..

I really really really do not wish to use .NET as there are over 26 pages based in classic ASP.. I would much prefer to fix the original problem rather than use a new programming enviroment and install a 26Mb .NET Redistributable package...

Thanks for commenting though :$

I tried running notepad instead, and ended up with a very warped graphics mess up... The titlebar... the icon... and a 1mm by 20mm Width regtangle white space box..

I looked for an update to Windows Scripting....none exists for Windows 2003
matthew1471Author Commented:
I still need to install the .NET redistributable on the server was what I meant....

I'll give it a few days for someone to suggest any other ideas, otherwise I guess i'll accept yours as being the answer, Windows Server 2003 does not like Windows Scripting Host...

It's a shame, I find .NET code generally longer and making less sense than classic ASP, also now there's that extra area of vulnerabilities on my server with running yet another process...

Sorry itcnbwise if my comments seem harsh, You seem to know what your on about :)
matthew1471Author Commented:
btw it wasn't running under the IUSER_ account, I ran the entire process under *my* credentials just to put an end to the possiblity that it was security issues, so "Administrator" should be able to run *anything*

but I fully believe you, Microsoft hates people who wont upgrade :P their Advertising budget on .NET must be out of this world... they *really* want people to use it
Hey, I hated the idea of dot net at first - I loved the ease and flexibility of vbscript.  Heck, if I wanted to code in VB I'd have made a custom DLL!  But in dot net you have to code in full VB, and using all these dot net classes.  It's a bear to learn, but once you get there, it is much cooler than ASP.

All the things we couldn't do (or needed 3rd party apps for) are done right in ASP.NET - uploading files, full email support, network functions, etc.

So I made a learning project for our programmers to learn ASP.NET - I've made the project a free downloadable open source forum program, get it here:
It's programmed in VB.NET for ASP.NET, with simple, easy-to-understand functions.  Hopefully it will help you learn .net if you go that route.

And if by some miracle you discover a way to make that classic code work on 2003 - by all means, post it here!

Best of luck,
matthew1471Author Commented:
:) I'm awarding it in the experts exchange approved category "It cant be done," thank you for posting the ASP.Net Solution I shall have to try it :)

Raises my paranoia on a .Net conspiracy... I'll now have a half ASP half .NET web app...

I should have just accepted even a Server component wouldnt work :P would have saved me a few hours

sorry for doubting you and thanks for the .NET code :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.