Powershell命令通过键盘远程打开Powershell

时间:2018-03-13 23:42:22

标签: powershell

我正在尝试使用send-key远程打开PowerShell。我无法使用Win键启动运行提示。有人可以在这帮忙。首先打开Teamviewer然后激活窗口并尝试通过命令提示符打开PS .Below是片段

    Start-Process "C:\Program Files (x86)\TeamViewer\TeamViewer.exe"
    $wshell = New-Object -ComObject wscript.shell
    $wshell.AppActivate('Teamviewer')
    $wshell.SendKeys("Windows{R}")
    Start-Sleep -Seconds 3
    $wshell.SendKeys('PowerShell')

0 个答案:

没有答案
相关问题