View Full Version : WSH Not working!

02-10-2003, 10:50 AM
Not sure why but WSH is not working for me.
I'm trying to run some python code with it but wsh isn't working.

Here is the code I'm using..

url = Request.QueryString("url")

Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("python pyvcd.py" & url)
strPResult = objCmd.StdOut.Readall()
set objCmd = nothing: Set objWShell = nothing


02-10-2003, 03:05 PM
Is the code working differently from how you expected, or is it not working at all?
Are you getting an error message?
Can you get any scripts to run with WSH?

Roy Sinclair
02-10-2003, 05:38 PM
Is the python program in the system path? If not you need to use a complete path to the executable.

02-11-2003, 01:42 AM
Have you tried running something else with WSH, like arnyinc asked (perhaps another VBScript file that contains:

MsgBox "Yo! This is working!"



02-11-2003, 06:47 AM
Well I have WSH working now, I downloaded the new version.

BUT! My code still isn't working. I have tried other things like ping and such but I can't write the contents of the window to the page which is vital if I want to use this python prog.

BTW: I had just formatted and re-installed windows including PWS, I forgot that I had downloaded an update of WSH last year which allowed this sort of stuff to work.

02-11-2003, 07:35 AM
Ok, I think the problem is that python may be executing to fast or something. So I'm going to have it hang before closing.

Here is the code at the moment:

url = "http://localhost/odyssey/services.asp"
Set objWShell = Server.CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("c:\python22\python.exe mypcvd.py http://localhost/odyssey/services.asp")
strPResult = objCmd.StdOut.Readall()
set objCmd = nothing
Set objWShell = nothing