Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post

    WSH Not working!

    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..
    Code:
    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 
     
    response.write(srtPResult)
    Omnis mico antequam dominus Spookster!

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    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?

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is the python program in the system path? If not you need to use a complete path to the executable.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you tried running something else with WSH, like arnyinc asked (perhaps another VBScript file that contains:

    MsgBox "Yo! This is working!"

    )?

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #5
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    Omnis mico antequam dominus Spookster!

  • #6
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    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:
    Code:
    <% 
    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() 
        response.write(strPResult)
        set objCmd = nothing
        Set objWShell = nothing 
    %>
    Omnis mico antequam dominus Spookster!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •