You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
904 B
17 lines
904 B
from . import CMDStr # Create CMD Strings
|
|
from . import Connector # RDP API
|
|
def ProcessStartIfNotRunning(inGlobalDict, inSessionIndex, inProcessName, inFilePath):
|
|
lCMDStr = CMDStr.ProcessStartIfNotRunning(inProcessName,inFilePath)
|
|
# Calculate the session Hex
|
|
lSessionHex = inGlobalDict["RDPList"][inSessionIndex]["SessionHex"]
|
|
# Run CMD
|
|
Connector.SessionCMDRun(inSessionHex=lSessionHex, inCMDCommandStr=lCMDStr, inModeStr="RUN")
|
|
# Create CMD str to stop process
|
|
def ProcessStop(inGlobalDict, inSessionIndex, inProcessName, inFlagForceClose)
|
|
lCMDStr = f'taskkill /im "{inProcessName}" /fi "username eq %USERNAME%"'
|
|
if inFlagForceClose:
|
|
lCMDStr+= " /F"
|
|
# Calculate the session Hex
|
|
lSessionHex = inGlobalDict["RDPList"][inSessionIndex]["SessionHex"]
|
|
# Run CMD
|
|
Connector.SessionCMDRun(inSessionHex=lSessionHex, inCMDCommandStr=lCMDStr, inModeStr="RUN") |