diff --git a/api/opusnt.py b/api/opusnt.py index c8f53f2..95dcf22 100644 --- a/api/opusnt.py +++ b/api/opusnt.py @@ -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