栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Windows

一招儿使你的Windows 8/RT关机更加便捷(vbs)

Windows 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

一招儿使你的Windows 8/RT关机更加便捷(vbs)

如果你是一位Windows 8用户,那么你会如何来关闭或重新启动你的设备呢?相信很多人都是按照先通过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)."
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/205712.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号