Python Crew

Discussion in 'OT Technology' started by Seeders, Oct 2, 2008.

  1. Seeders

    Seeders New Member OT Supporter

    Jul 10, 2007
    Likes Received:
    Im running a python script as a service in windows (we just got SP3 and Python 2.5.2).

    Before (while running SP2 and python 2.0), our script had a thread that would force windows to logout and log back in again if our group policy scripts had not yet finished. This was all fine and still works.

    However, now that we have upgraded, whenever the python script tells windows to log out, instead of just the thread closing, the whole script gets stopped. When the machine logs back in, the service for our python script is still running, but the script itself is not.

    I made a test script that just prints a timestamp to a file every 2 seconds while the thread that causes windows to logoff runs. It prints out for a few seconds, but whenever windows logs off the timestamps stop and do not resume when windows logs back in.

    Anyone know why?

    def GPVerifyThread():
        os.spawnv(os.P_NOWAIT, r"c:\windows\system32\cmd.exe", [r"c:\windows\system32\cmd.exe", r"/c", r"c:\windows\scripts\ssglogin.vbs"])
    thread.start_new_thread(GPVerifyThread, ())
    while 1:
        log_file = open("C:\pyscripts\iKiller.log" , 'a')

Share This Page