We are all believe security. But sometimes security become a bottleneck for our productivity. Enterprises generally put automatic screen lock after idle time for windows operating systems by using security policy.
我们都相信安全。 但是有时安全性成为我们生产力的瓶颈。 企业通常使用安全策略在Windows操作系统空闲时间后设置自动屏幕锁定。
I think this is very good enforcement because I see a lot of workers do not mind this type of security measures. But when using windows in VM it become a bottleneck entering password for a lot of times. Here is a script based solution. Save this script as idle.vbs
and then double click it or more convenient start it with task manager for start at startup automatically.
我认为这是非常好的执法,因为我看到很多工人不介意此类安全措施。 但是,在VM中使用Windows时,多次输入密码成为瓶颈。 这是基于脚本的解决方案。 将此脚本另存为idle.vbs
,然后双击它或更方便的使用任务管理器启动它,以便在启动时自动启动。
idle.vbs脚本 (idle.vbs Script)
Following script is developed in Visual Basic scripting language which can be run most of the Windows operating systems like Windows XP, Windows 7, Windows 8, Windows 10, Windows Server 2008, Windows Server 2012, Windows Server 2016 . We will use CreateObject
function which will used to send some trivial key strokes to the operating system. This will prevent system to lock the screen. The sending key interval will be set as 6000
milisecond which is fair. We will use Sleep
function in order to prevent the script run for ever in a brute force mode.
以下脚本是使用Visual Basic脚本语言开发的,可以在大多数Windows操作系统(如Windows XP,Windows 7,Windows 8,Windows 10,Windows Server 2008,Windows Server 2012,Windows Server 2016)上运行。 我们将使用CreateObject
函数,该函数用于将一些简单的按键发送到操作系统。 这将防止系统锁定屏幕。 发送密钥间隔将设置为6000
毫秒,这是公平的。 我们将使用Sleep
功能,以防止脚本在暴力模式下永远运行。
Dim objResult
Set objShell = WScript.CreateObject("WScript.Shell")
i = 0
Do While i = 0
objResult = objShell.sendkeys("{NUMLOCK}{NUMLOCK}")
Wscript.Sleep (6000)
Loop
6000 means 6 seconds the script sends NUMLOCK to prevent screen lock. We can change it according our policy interval.
6000表示脚本在6秒钟内发送了NUMLOCK以防止屏幕锁定。 我们可以根据我们的政策间隔进行更改。
翻译自: https://www.poftut.com/how-to-prevent-security-policy-enforced-screen-lock-in-windows/