Upgrade OSCMD in Orchestrator - it will create new console window for cmd commands

dev-linux
Ivan Maslov 4 years ago
parent b0846aa9b1
commit e10f774e9d

@ -4,6 +4,7 @@ from . import Timer
from . import Processor from . import Processor
from . import BackwardCompatibility # Backward compatibility from v1.1.13 from . import BackwardCompatibility # Backward compatibility from v1.1.13
from . import Core from . import Core
from subprocess import CREATE_NEW_CONSOLE
from .Utils import LoggerHandlerDumpLogList from .Utils import LoggerHandlerDumpLogList
# ATTENTION! HERE IS NO Relative import because it will be imported dynamically # ATTENTION! HERE IS NO Relative import because it will be imported dynamically
@ -210,7 +211,7 @@ def OSCMD(inCMDStr, inRunAsyncBool=True, inLogger = None):
def _CMDRunAndListenLogs(inCMDStr, inLogger): def _CMDRunAndListenLogs(inCMDStr, inLogger):
lResultStr = "" lResultStr = ""
lOSCMDKeyStr = str(uuid.uuid4())[0:4].upper() lOSCMDKeyStr = str(uuid.uuid4())[0:4].upper()
lCMDProcess = subprocess.Popen(f'cmd /c {inCMDStr}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT) lCMDProcess = subprocess.Popen(f'cmd /c {inCMDStr}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT, creationflags=CREATE_NEW_CONSOLE)
if inLogger: if inLogger:
lListenBool = True lListenBool = True
inLogger.info(f"{lOSCMDKeyStr}: # # # # CMD Process has been STARTED # # # # ") inLogger.info(f"{lOSCMDKeyStr}: # # # # CMD Process has been STARTED # # # # ")

Loading…
Cancel
Save