北海亭

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

电脑办公  2025-10-31 05:02:23  热度:14℃

假如你是一位Windows 8用户,那么你会如何来关闭或重新启动你的设备呢?相信很多人都是按照先通过Win+C快捷键呼出Charms边栏,然后再依次点击“设定”和“电源”按钮的方法来实现关机操作。

注意,假如无法正常看到文件扩展名的话,那么请启用Windows 8系统“文件夹选项”中的“显示文件扩展名”功能。

然后将下面这些代码全部复制粘贴到文本当中,而后再将文本文件的文件扩展名由“.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)."

最近更新

  • Strategy公司比特币引擎增速放缓,分析师称其仍具备长期潜力

    Strategy公司比特币引擎增速放缓,分析师称其仍具备长期潜力

    2025-11-0432阅读

  • Luxxcoin创新模式挑战模因币投机:Solana生态迎来基于价值的MemeFi项目

    Luxxcoin创新模式挑战模因币投机:Solana生态迎来基于价值的MemeFi项目

    2025-11-0463阅读

  • 11月加密货币股票焦点:CRCL、BMNR与HOOD的上涨潜力分析

    11月加密货币股票焦点:CRCL、BMNR与HOOD的上涨潜力分析

    2025-11-0462阅读

  • 墨西哥央行确认全面资产支持,应对用户提款激增

    墨西哥央行确认全面资产支持,应对用户提款激增

    2025-11-0418阅读

  • Bittensor TAO 价格飙升至 510 美元以上,目标价位是 540 美元和 580 美元吗?

    Bittensor TAO 价格飙升至 510 美元以上,目标价位是 540 美元和 580 美元吗?

    2025-11-0459阅读

  • 比特币价格预测:2025年底能否突破15万美元大关?

    比特币价格预测:2025年底能否突破15万美元大关?

    2025-11-0418阅读

  • 近年来对XRP持有者最重要的日期:11月13日或成历史性时刻

    近年来对XRP持有者最重要的日期:11月13日或成历史性时刻

    2025-11-0443阅读

  • 美联储降息对BTC/USD价格的影响及数据缺口的市场分析

    美联储降息对BTC/USD价格的影响及数据缺口的市场分析

    2025-11-0440阅读

  • 清崎再发“大规模崩盘”警告:建议投资者转向比特币和以太坊

    清崎再发“大规模崩盘”警告:建议投资者转向比特币和以太坊

    2025-11-0418阅读

  • 比特币期货市场:多空失衡下的战略机遇与风险应对

    比特币期货市场:多空失衡下的战略机遇与风险应对

    2025-11-0451阅读

  • 精选专题