subprocess.Popen not executing properly

63 Views Asked by At

I am trying to execute non-blocking cmd command. However, the command I want to run seems to be skip(doesn't do anything and just passes)

subprocess.Popen(["cmd", "/c", "C:/Program Files/BlueStacks_nxt/HD-Player.exe", "--instance", "Nougat32"], 
    shell=False, stdin=None, stdout=None, stderr=None, close_fds=True
)

Also tried to set shell=True but didn't work either. It works fine if I add .communicate() or just use os or subprocecss.run() but not the wanted behavior since it blocks.

Tested out if opening a Txt file works and it did work fine -

subprocess.Popen(
    ["C:/Windows/Notepad.exe", "C:/Users/SomeUser/Desktop/File.txt"], 
    shell=False, stdin=None, stdout=None, stderr=None, close_fds=True
)

Any idea why this is happening and how to fix it?

0

There are 0 best solutions below