- 首页 > 服务中心 > 帮助中心 > 电脑学堂
- 
			安舟网络教你自定义快速关机和睡眠键发布时间:2012/7/25 16:39:26为了更好地建设网站,今天给公司置了台新电脑。但是发觉键盘却没有快速关机和睡眠键,这样使用不太方便,于是动手DIY设置自定义一下这两个键。下面给大家介绍一下 方法一:写个VBS,程序运行后,在桌面上生成2个隐藏的快捷方式,分别定义休眠键和关机键为F11、F12。(注:要使用自定义的休眠键,需要启用系统的休眠功能) Set objSuspend = objShell.CreateShortcut(strLnk1) 
 objSuspend.TargetPath = strSuspendVBS
 objSuspend.WindowStyle = 1
 objSuspend.Hotkey = "F11"
 objSuspend.IconLocation = strSystemFolder & "\Shell32.dll,20"
 objSuspend.Description = "系统休眠"
 objSuspend.WorkingDirectory = objShell.SpecialFolders("Desktop")
 objSuspend.Save
 Set objFile1 = objFSO.GetFile(strLnk1)
 objFile1.Attributes = objFile1.Attributes Xor Hidden
 strPowerOffVBS = strSystemFolder & "\SetPowerOff.vbs"
 strText2 = "CreateObject(""WScript.Shell"").Run ""Shutdown -s -t 0"""
 objFSO.OpenTextFile(strPowerOffVBS,ForWriting,True).Write strText2
 strLnk2 = objShell.SpecialFolders("Desktop") & "\SetPowerOff.lnk"
 Set objPowerOff = objShell.CreateShortcut(strLnk2)
 objPowerOff.TargetPath = strPowerOffVBS
 objPowerOff.WindowStyle = 1
 objPowerOff.Hotkey = "F12"
 objPowerOff.IconLocation = strSystemFolder & "\Shell32.dll,27"
 objPowerOff.Description = "系统关闭"
 objPowerOff.WorkingDirectory = objShell.SpecialFolders("Desktop")
 objPowerOff.Save
 Set objFile2 = objFSO.GetFile(strLnk2)
 objFile2.Attributes = objFile2.Attributes Xor Hidden
 WScript.Echo "已设置休眠热键为F11,关机热键为F12"
 Set objFSO = Nothing
 Set objShell = Nothing方法二: 1.在桌面上单击右键。 
 2.从弹出菜单中选择“新建|快捷方式”。
 3.在“创建快捷方式”对话框中输入“rundll32.exe powrprof.dll,SetSuspendState”
 4.单击“下一步”。
 5.在“选择程序标题”对话框中输入“休眠”。单击“完成”。这样在桌面上就有了一个名为“休眠”快捷方式。下面我们为其指定快捷键。 在桌面上的“休眠”快捷方式上单击右键,打开“休眠”属性对话框中的“快捷方式”选项卡中单击“快捷键”右侧文本框,然后按下自己喜欢的快捷键,如F8。 如此一来,以后只需按F8键就可实现一键休眠了。 
 转帖请自觉加入安舟佛山网站建设 文章转自:(http://www.anjoweb.com/shownews_570.html)
 






