#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    40
    Rep Power
    12

    Running a win32 com Python script from Cygwin cron


    I'm trying to run a Python script from a Cygwin cron job. Here's my Python script:

    Code:
    import win32com.client, time
    ie = win32com.client.Dispatch( "InternetExplorer.Application" )
    time.sleep( 3 )
    ie.Visible = 1
    And here's the command I run:

    Code:
    /cygdrive/c/Python22/python.exe c:\\Laszlo\\sandbox\\antun\\opener.py 2>&1 > /tmp/smelly
    I can run the above command with no problems from the Cygwin Bash shell. The Internet Explorer window opens up.

    However, when I run it from a cron job, the iexplore.exe service does start (I can see it in the Windows Task Manager), but the window never becomes visible. The /tmp/smelly file (which should contain any output) is empty.

    Any ideas?

    Thanks,

    Antun
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    1
    Rep Power
    0

    Exclamation I ran something like this successfully fro Windows scheduling


    use like

    my.cmd

    -----------------------------------------------
    REM My.cmd file
    c:\cygwin\bin\bash -login ~/bin/mysript.sh param1 param2
    ----------------------------------------------------

    It runs from you user directory,

    I'd but this cmd file in my widows job

    Runs perfectly

    Moisey o.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    40
    Rep Power
    12

    Thumbs up


    Thank you! That worked. I know it's been a while, but I had shelved this project, and have only just found the time to implement it. It's working perfectly now.

    -Antun

    Originally Posted by moiseyo
    use like

    my.cmd

    -----------------------------------------------
    REM My.cmd file
    c:\cygwin\bin\bash -login ~/bin/mysript.sh param1 param2
    ----------------------------------------------------

    It runs from you user directory,

    I'd but this cmd file in my widows job

    Runs perfectly

    Moisey o.

IMN logo majestic logo threadwatch logo seochat tools logo