|
回复 6# 的帖子
Hi lingxin,
能否明确指出你想通过Ctrl+Alt+Del执行什么操作?
1。 如果你想打开资源管理器TaskManager, 请用这个代替:
set WshShell = CreateObject("Wscript.Shell")
WshShell.SendKeys "^+{ESC}"
‘ 即CTRL-SHIFT-ESC
2。如果你想在local本地的情况下锁屏,请使用:
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "%windir%\System32\rundll32.exe user32.dll,LockWorkStation"
//------------------------------
请参考Microsoft的官方说明:
http://www.microsoft.com/technet ... /nov04/hey1115.mspx
您明显没有仔细阅读我前面回复中提供的链接内容,所以以防万一,我复制过来:
In fact, the only way we could figure out how to lock a computer using a script was to write a script that did nothing more than use Rundll32.exe to call the LockWorkStation method of user32.dll:
On Error Resume Next
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "%windir%\System32\rundll32.exe user32.dll,LockWorkStation"
This works great for the local computer, but doesn’t do you much good if you’re trying to lock a remote computer; you can’t specify a remote computer name when running Rundll32.exe. But that’s OK: if this script only runs locally, then all we have to do is make sure it runs locally on the remote computer.
//----------------------------------------------------
3。 如果你的情况和这个人类似(local, 不使用VNC的情况下):
“I have a nocturne routine, but it's fully User Interface, everithing works
good, but at that hour (2 am) my server is Locked and doesn't Run this
routine, is there any way to put in the script a method to unlock the
computer... “
官方回复:
“can you write a script that unlocks a workstation? As far as we know, you can’t; in fact, as far as we know the only way to unlock a workstation is to have someone go to the computer, press Ctrl-Alt-Delete and log on.”
from http://www.microsoft.com/technet ... /nov04/hey1115.mspx
个人建议,使用google search你会找到你想要的答案,或者到这个论坛:http://www.sqaforums.com/postlist.php?Cat=0&Board=UBB20 这里高手很多。 |
|