English 中文(简体)
如何防止使用VBscript的XP机器的自动锁定特征
原标题:How to prevent auto-locking feature of an XP machine using VBscript

机器在自动化文字操作期间被锁定,这是因为不同文字之间的间隔很长(出于某种原因需要)。 我想避免这种自动锁定的特点。 问题在于,根据安全政策,我们不能从控制小组中排除这一特征。 是否有其他办法使该制度不受约束?

最佳回答

我认为,你可以通过定期发送关键词来停止锁定,因此我建议查看

仔细了解你重新派出的关键是什么,这样你不会影响任何东西。

问题回答

我这样做了。 它派出2个SCROLLOCK 关键人物很快会对任何申请进行干涉(甚至不会有任何严重的途径)。 它每60秒......。 Cheers!

set wsc = CreateObject("WScript.Shell")
Do
WScript.Sleep (60*1000)
wsc.SendKeys ("{SCROLLLOCK 2}")
Loop

停止这种做法、开放任务并终止规定。 退出进程。 (如果存在多个方面,使用指挥线一栏标出哪个过程)

I use a pair of file...

第一份档案(Keep_Awake__start.vbs)保存着觉醒/未锁。 第二份档案(Keep_Awake__end.vbs)在你希望回到正常的原状时,便捷地终止了这一进程。

第一份档案......

  Keep_Awake__start.vbs
  Graham Edwards

  Typical stored in Start Menu 
 
  Use Keep_Awake__start.vbs to keep the computer from inactivity-based lockouts.
  Use Keep_Awake__end.vbs to remove Keep_Awake__start.vbs

  Largely pulled from st0le response
  Http://stackoverflow.com/questions/4457907/how-to-prevent-auto-locking-feature-of-an-xp-machine-using-vbscript

  --- Define Object
    set wsc = CreateObject("WScript.Shell")

  --- Loop every so many minutes and change the scroll lock setting 
    Do
          Wait for ~2 minutes
        WScript.Sleep (2*60*1000)
        wsc.SendKeys ("{SCROLLLOCK 2}")
    Loop

第二份档案......

  Keep_Awake__end.vbs
  Graham Edwards

  Use Keep_Awake__start.vbs to keep the computer from inactivity-based lockouts.
  Use Keep_Awake__end.vbs to remove Keep_Awake__start.vbs

  Largely pulled from Ansgar Wiechers response
  http://stackoverflow.com/questions/22324899/kill-a-vbscript-from-another-vbscript

  --- Define Object
    Set wmi = GetObject("winmgmts://./root/cimv2")

  --- Search and Destroy
    qry = "SELECT * FROM Win32_Process WHERE Name= wscript.exe  AND NOT " & _
    "CommandLine LIKE  %" & Replace(WScript.ScriptFullName, "", "\") & "% "

    For Each p In wmi.ExecQuery(qry)
      p.Terminate
    Next

  --- Clean up
    Set wmi = Nothing   Release the Application object

这些档案可以由定期文本编辑制作,存放在任何地方(如你的台式)。 一旦你将档案保存下来,可以起诉。 因此,你只得把点击两点,以开始或结束事情(视你双重点击)。

您可以把“Awake_start.vbs”储存在Windowsstartup的夹中,以便一俟您的标识就发射。

最为简单的解决方案是打开双球或视频文档,并在窗户媒体角色(使用重复性特征和变压参与者的体积)中不断播放。 这样,屏幕永远不会出现,系统永远不会锁定。

如果在管理您的自动化设备时,则使用您的自动化设备,经常做一次tw事。 我发现,如果你有自己的习惯睡觉功能,作为你睡觉的一部分,你会敲碎 mo。 在文字之间长的间隔使用。

采用以下VB字母代码,使你的机器不受束缚:

Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite "HKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsControl PanelDesktopScreenSaverIsSecure", "0" , "REG_SZ"
Wscript.Echo "Your machine remains unlocked"

Cheers!!

Set wshShell =wscript.CreateObject("WScript.Shell")
do
  wscript.sleep 55000
  wshshell.sendkeys "{SCROLLLOCK}"
loop

我们可以利用这一守则,防止窗户再次 un。

我这样做了。

(外圈=已申报变量)

 For 64 bit Excel.
Private Declare PtrSafe Function SetCursorPos Lib "user32" _
                        (ByVal x As Long, _
                        ByVal y As Long) As Long
Private Declare PtrSafe Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

 For 32 bit Excel.
Private Declare Function SetCursorPos Lib "user32" _
                        (ByVal x As Long, _
                        ByVal y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long


   default variable
 private mousecounter as integer

(程序)

Dim llCoord As POINTAPI
Dim activeXMousePos As Integer
Dim activeYMousePos As Integer

GetCursorPos llCoord
activeXMousePos = llCoord.Xcoord
activeYMousePos = llCoord.Ycoord

(休息):

        If mousecounter <= 2 Then
            SetCursorPos activeXMousePos - 1, activeYMousePos - 1
            mousecounter = mousecounter + 1
        End If

        If mousecounter > 2 Then
            SetCursorPos activeXMousePos + 2, activeYMousePos + 2
            mousecounter = 0
        End If

因此,这部法典基本上将每处间休息1个 p子和1个 p右lor的lor头换起来。 你可以宣布任何其他价值观,但我发现,这种改变不会使用户.。

如果任何人需要有条件的声明

#If vba7 and win64 then

 For 64 bit Excel.
Private Declare PtrSafe Function SetCursorPos Lib "user32"  (ByVal x As Long,  ByVal y As Long) As Long
Private Declare PtrSafe Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long


#Else

 For 32 bit Excel.
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long,  ByVal y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

#End If

I have made a very simple and easy to use script(.bat) which disabled autolock by running the script in a console(cmd) window. If you want to stop the script, the user just need to close the console window. #disable_autolock_stackoverflow_mr_v

 :: SAVE this script as a .bat file and execute it to disable autolock   
 @echo off
 COLOR 0A
 mode 69,9
 title Stay Awake
 echo Dim objResult > %temp%stay_awake.vbs
 echo Set objShell = WScript.CreateObject("WScript.Shell")    >> %temp%stay_awake.vbs
 echo Do While True >> %temp%stay_awake.vbs
 echo  objResult = objShell.sendkeys("{NUMLOCK}{NUMLOCK}") >> %temp%stay_awake.vbs
 echo  Wscript.Sleep (5000) >> %temp%stay_awake.vbs
 echo Loop >> %temp%stay_awake.vbs
 echo Start Time: %date% %time%
 ECHO Please close this window to stop the Stay_Awake Script
 echo.
 cscript %temp%stay_awake.vbs




相关问题
Deploying WCF application

I have IIS-Hosted WCF application and services. I want to automate the process to deploy this application into test/Acceptance test/production environments What is the best way to automate the process ...

CGWindowID from AXUIElement

I m trying to automate a foreign OSX application using the accessibility API. Some of the state of the application isn t available through the API, so I acquire it through screen scraping. To do this, ...

Snapping pictures from Windows C# Canon SDK vs PTP or MTP

I am hoping to receive some general guidance on accomplishing a seemingly simple goal. I have a DSLR camera (Canon EOS 50D) and need to write an application that will tell the camera to take a ...

热门标签