小技巧让你的Windows 8/RT关机更加便捷(vbs)
更新日期:2016-11-26 19:37:48
来源:互联网

关闭或重新启动设备是用户们常做的一件事,那么你会如何来关闭或重新启动你的设备呢?对于win8用户来说,很多人都是按照先通过Win+C快捷键呼出Charms边栏,然后再依次点击“设定”和“电源”按钮的方法来实现关机操作。
不过,近日有来自XDA开发者论坛的用户分享了一种更加简单的关机/重启方法,并表示该方法适合所有运行Windows 8/RT操作系统的PC及平板电脑。
据该用户介绍,这种方法的基本思路是通过一段VBS脚本代码来为Windows 8的开始屏幕添加具备关机/重启功能的“磁贴”,从而实现更加直观快捷的操作。
具体来说,用户首先要新建一个任意名字的空白TXT文本(如Shutdown.txt),然后将下面图片中所显示的这些代码全部复制粘贴到文本当中,而后再将文本文件的文件扩展名由“.txt”修改为“.vbs”,使之成为一个VBS脚本文件。
注意,如果无法正常看到文件扩展名的话,那么请启用Windows 8系统“文件夹选项”中的“显示文件扩展名”功能。
最后,用户只需要双击运行刚才这个VBS脚本文件,就能够在Windows 8/RT系统就会在开始屏幕中创建具备关机/重启功能的“磁贴”。
另外,从目前XDA论坛的用户反馈来看,这种方法确实有效,所以欢迎大家也都动手体验试用。
然后将下面这些代码全部复制粘贴到文本当中,而后再将文本文件的文件扩展名由“.txt”修改为“.vbs”,使之成为一个VBS脚本文件,双击运行即可
代码如下:
set WshShell = WScript.CreateObject("WScript.Shell")
strStartMenu = WshShell.SpecialFolders("StartMenu")
set oShellLink = WshShell.CreateShortcut(strStartMenu & "Shutdown.lnk")
oShellLink.TargetPath = "%systemroot%System32shutdown.exe"
oShellLink.Arguments = "-s -t 0"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%systemroot%System32shell32.dll,27"
oShellLink.Description = "Shutdown Computer (Power Off)"
oShellLink.WorkingDirectory = "%systemroot%System32"
oShellLink.Save
Set oShellLink = Nothing
set oShellLink = WshShell.CreateShortcut(strStartMenu & "Log Off.lnk")
oShellLink.TargetPath = "%systemroot%System32shutdown.exe"
oShellLink.Arguments = "-l"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%systemroot%System32shell32.dll,44"
oShellLink.Description = "Log Off (Switch User)"
oShellLink.WorkingDirectory = "%systemroot%System32"
oShellLink.Save
Set oShellLink = Nothing
set oShellLink = WshShell.CreateShortcut(strStartMenu & "Restart.lnk")
oShellLink.TargetPath = "%systemroot%System32shutdown.exe"
oShellLink.Arguments = "-r -t 0"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%systemroot%System32shell32.dll,176"
oShellLink.Description = "Restart Computer (Reboot)"
oShellLink.WorkingDirectory = "%systemroot%System32"
oShellLink.Save
Set oShellLink = Nothing
Wscript.Echo "Shutdown, Restart and Log Off buttons have been created. You can now pin them to the Start Screen of your Windows 8 computer (if they are not already there)."
猜你喜欢
-
系统资讯 梦想与现实的差距国产系统举步维艰 14-10-18
-
win7系统不能格式化分区的应对策略 14-11-25
-
教大家如何增加windows7系统纯净版的C盘内存空间 15-02-26
-
windows7系统纯净版如何关闭自动更新重启提示窗口 15-03-21
-
妙以金山卫士搞定深度技术win7中病毒导致黑屏的窘状 15-05-08
-
深度技术win7旗舰版电脑蓝屏攻击的3大形式 15-05-08
-
风林火山win7旗舰版64位打造光标阴影立体效果的方法 15-06-23
-
番茄花园win7系统是怎么删除病毒文件夹的 15-06-12
-
技术员联盟win7快速启动栏在哪个地方 15-06-01
Win7系统安装教程
Win7 系统专题
