We help IT Professionals succeed at work.

Exec program since Personal Web server

rxolotl
rxolotl asked
on
Medium Priority
203 Views
Last Modified: 2008-03-06
How can i exec programm since personal web server
Comment
Watch Question

Use Run Method of Windows scripting host

The following VBScript code opens a copy of the currently running script with Notepad.

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\notepad " & WScript.ScriptFullName
The following VBScript code does the same thing, except it specifies the window type, waits for Notepad to be shut down by the user, and saves the error code returned from Notepad when it is shut down.

Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, true)

OR
go to http://www.serverobjects.com/products.htm#free and get AspExec. Install and use it.Its very good and works like a charm

Author

Commented:
It doesn work.
another idea?
MCM

Commented:
under IIS, you can do the following:  

in a file with extension .stm, use the server-side directive:

<!--#EXEC CMD="[command]"-->

or perhaps

<!--#EXEC CMD="cmd /c [command]"-->

i don't know whether this will work under pws, but you can give it a shot.


What do you mean by 'it doesn't work' ? What did you do ? Whats is your code ?
Lets see your code

Author

Commented:
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("c:\test\test.bat" & WScript.ScriptFullName, 1, true)

I use this code.
but hading an error when i run second line

MCM
i work with <!--#EXEC CMD="[command]"-->
and nothing happends.
Commented:
try the second syntax:
<!--#EXEC CMD="cmd /c [command]"-->

if that doesn't work, forget my idea; as i mentioned, I don't know is PWS will dot he execs. you might try the ASPExec solution proposed earlier; windows script host is not ASP and so you won't be able to use it; there is no "Run" under ASP.

Author

Commented:
thanks i must gives you half and half guys

Explore More ContentExplore courses, solutions, and other research materials related to this topic.