在Windows中需要一个启动脚本来发送ALT + F11键吗?

时间:2013-08-13 07:38:04

标签: windows batch-file cmd

我们在瘦客户端上使用共享桌面。默认情况下它带有窗口屏幕,但是按 Alt + F11 键它将恢复到全屏。因此,我们希望脚本在Windows登录时执行有一些延迟。

1 个答案:

答案 0 :(得分:2)

希望登录vbscript对您有用。将此附加到现有登录脚本或将其另存为“.vbs”文件。 Microsoft has some good tutorials if you are unfamiliar with login scripts.

Set WshShell = CreateObject("Wscript.Shell") 'Create wshell object
WScript.Sleep(5000) 'Lets wait 5 seconds

WshShell.AppActivate "EXACT TITLE OF THE WINDOW YOU WANT" 'EDIT THIS LINE!
'The line above selects the window so we make sure the keystrokes are sent to it

WshShell.SendKeys "%{F11}" 'Send ALT+F11
Wscript.Quit 'Quit the script