小技巧让你的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)."
猜你喜欢
-
微软将win7换成替补 win8成首发 14-10-16
-
U盘在安装完win7 32位纯净版系统过后出现格式化错误的问题怎么办 15-01-01
-
win7 64位纯净版系统里面该如何关闭mmcss服务 15-01-13
-
win7系统纯净版安装IE10浏览器失败怎么解决 15-01-28
-
同步win7 sp1 ghost纯净版资源管理器视图的具体步骤 15-03-20
-
系统之家win7解决游戏不能全屏的问题 15-06-11
-
深度技术win7系统中哪些最容易被忽略的初始必要设置项 15-06-19
-
如何使用一个键将雨林木风win7系统还原 15-06-12
-
在番茄花园win7系统中鲜为人知的F2键 15-06-09
-
win7分区越多越糟的原因看系统之家全面解析给你听 15-06-01
Win7系统安装教程
Win7 系统专题
