mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 01:30:20 +00:00
Use cmd /c with runas on Windows to allow compound commands
This commit is contained in:
parent
ab9e02a1a9
commit
8c8792d81b
1 changed files with 2 additions and 2 deletions
|
@ -209,7 +209,7 @@ def runas(cmdLine, username, password=None, cwd=None):
|
|||
int(user_token),
|
||||
logonflags=1,
|
||||
applicationname=None,
|
||||
commandline=cmdLine,
|
||||
commandline=f'cmd /c "{cmdLine}"',
|
||||
currentdirectory=cwd,
|
||||
creationflags=creationflags,
|
||||
startupinfo=startup_info,
|
||||
|
@ -310,7 +310,7 @@ def runas_unpriv(cmd, username, password, cwd=None):
|
|||
domain=domain,
|
||||
password=password,
|
||||
logonflags=salt.platform.win.LOGON_WITH_PROFILE,
|
||||
commandline=cmd,
|
||||
commandline=f'cmd /c "{cmd}"',
|
||||
startupinfo=startup_info,
|
||||
currentdirectory=cwd,
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue