Ditto
This commit is contained in:
parent
ec5c716889
commit
18e7e4f187
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue