-
-
- %windir%\system32\rundll32.exe user32.dll,LockWorkStation
-
-
-
- set ws=WScript.CreateObject("WScript.Shell")
-
- ws.Run "c:\AutoLockScreen.bat /start",0
//AutoLockScreen.bat
%windir%\system32\rundll32.exe user32.dll,LockWorkStation
// AutoLockScreen.vbs
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "c:\AutoLockScreen.bat /start",0
直接运行AutoLockScreen.vbs即可!
如果直接执行AutoLockScreen.bat, 程序可能不会自动退出,但通过上边这种方法可以实现自动退出。