2017-01-13 33 views
-2

我試圖讓vbs打開「系統屬性保護」窗口。然後運行Sendkeys命令來配置按鈕。該腳本打開系統屬性保護正常。但同樣它沒有得到sendkeys發送到。回聲框會彈出。但是,看不到配置按鈕並打開它。我希望有人能幫助我。它看起來像腳本沒有訪問系統屬性保護窗口。VBS將sendKeys命令運行到systempropertiesprotection菜單

Option Explicit 
Dim WshShell:Set WshShell=CreateObject("Wscript.Shell") 
WshShell.run "systempropertiesprotection" 
    Wscript.Sleep 1000 
    WshShell.SendKeys ("{tab}") 
    WshShell.SendKeys ("{tab}") 
    WshShell.SendKeys ("{~}") 
    Wscript.echo "Open" 
Wscript.quit 
+1

你究竟在努力完成什麼?禁用系統保護?更改用於系統保護的最大磁盤空間?刪除所有還原點?有適當的方法可以做到不涉及'SendKeys'。 SendKeys'非常不可靠。 – Helen

+0

@ Helen可能無法從他們試圖運行它的地方訪問正確的方式,這使我懷疑它們應該是什麼。 – Lankymart

回答

0

嘗試從管理命令提示符運行腳本。

運行:在這種方式啓動時

set s=createobject("wscript.shell") 
s.run "systempropertiesprotection" 
wscript.Sleep 500 
s.sendkeys("{tab} 2") 
s.sendkeys("{ }") 

...對我的作品。