0

I have a executable made by py2exe which verifies whether my VPN is connected or not at infinite loop running on Windows. I want to make sure it runs in background or hidden, I searched for several forums and I found 2 scripts worked partially.

  1. Rename script to scrypt.py and run py2exe again, the .exe hide when I run it, but close or vanish. Doesn't continue running after the click.

  2. I am made another exe to call the first

    import os
    import subprocess

    os.chdir("C:\Users\dl\Documents\Log\Py")
    proc = subprocess.Popen('ipLog.exe',  creationflags=subprocess.SW_HIDE, shell=True)
    proc.wait()

or

    os.chdir("C:\Users\dl\Documents\Log\Py")
    proc = subprocess.Popen('ipLog.exe',  creationflags=subprocess.SW_HIDE, shell=True)

Works but the first command still visible, and when i close it, the first exe call by it quit too.

  1. I tried install a module call self.hide but i cant.

I am newbie in python and try to change my hobbies vb, vba to python.

Thanks for any help.

rhoitjadhav
  • 691
  • 7
  • 16
vbajr
  • 31
  • 1
  • 6

1 Answers1

1

I found a solution in this thread How to start daemon process from python on windows?. Thank you all people helped with this thread, help my script too.

Community
  • 1
  • 1
vbajr
  • 31
  • 1
  • 6