Batch file Bat文件,自动注销我的电脑

Batch file Bat文件,自动注销我的电脑,batch-file,Batch File,我想恶作剧我的同事,我需要一些帮助 我需要一个.bat脚本,它将在有人按下我键盘上的任何按钮后注销我的计算机 有人能帮我吗 使用脚本,您可以重新映射Win+L快捷方式,并为睡眠创建另一个我选择的Win+S快捷方式,除非您使用OneNote,否则通常不使用: #l:: ; Win+L Shutdown, 0 ; this is the code for Log Off return #s:: ; Win+S DllCall("PowrProf\SetSuspen

我想恶作剧我的同事,我需要一些帮助

我需要一个.bat脚本,它将在有人按下我键盘上的任何按钮后注销我的计算机

有人能帮我吗

使用脚本,您可以重新映射Win+L快捷方式,并为睡眠创建另一个我选择的Win+S快捷方式,除非您使用OneNote,否则通常不使用:

#l::         ; Win+L
Shutdown, 0  ; this is the code for Log Off
return

#s::         ; Win+S
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0) ; DLL call to sleep
return
AutoHotkey的帮助文件中有关于DLL调用的更多详细信息:

; Call the Windows API function "SetSuspendState" to have the system suspend or hibernate.
; Windows 95/NT4: Since this function does not exist, the following call would have no effect.
; Parameter #1: Pass 1 instead of 0 to hibernate rather than suspend.
; Parameter #2: Pass 1 instead of 0 to suspend immediately rather than asking each application for permission.
; Parameter #3: Pass 1 instead of 0 to disable all wake events.
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)