Код: Выделить всё
New-Item -ItemType SymbolicLink -Path "C:\Users\user1\Saved Games\Scripts\BIOS" -Target "C:\Users\user1\Saved Games\bios\Scripts\BIOS"
Я думаю, это может быть что-то вроде:
Код: Выделить всё
def run_cmd(*args):
p = subprocess.Popen(*args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, error = p.communicate()
return out, error
cmd_symlink = '"New-Item -ItemType SymbolicLink -Path "C:\Users\user1\Saved Games\Scripts\BIOS" -Target "C:\Users\user1\Saved Games\bios\Scripts\BIOS"'
ps_command = f"& {{Start-Process powershell.exe -argumentlist '-command {cmd_symlink}' -Verb RunAs}}"
command = ['powershell.exe', '-command', ps_command]
run_cmd(command)
Подробнее здесь: https://stackoverflow.com/questions/790 ... subprocess