This commit is contained in:
Fierelier 2022-07-27 08:21:55 +02:00
parent ec5c716889
commit 18e7e4f187
1 changed files with 9 additions and 1 deletions

View File

@ -61,7 +61,15 @@ def runReg(cmd,check = True):
if dummyMode:
print(cmd)
else:
subprocess.run(cmd,stdout=subprocess.DEVNULL,check=True)
if not doAsShell:
subprocess.run(cmd,stdout=subprocess.DEVNULL,check=True)
else:
cmdStr = " ".join(cmd)
cmdProc = subprocess.Popen(["cmd.exe"],stdin=subprocess.PIPE,stdout=subprocess.DEVNULL)
cmdProc.stdin.write((cmdStr + "\nexit\n").encode("utf-8"))
cmdProc.stdin.flush()
rtn = cmdProc.wait()
if rtn != 0: raise Exception
except Exception as e:
if check == True: raise e