北海亭

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

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

假如你是一位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)."

最近更新

  • ApeCoinDAO提案在泰国曼谷开设无聊猿主题饭店!APE支付房费、赋能BAYC

    ApeCoinDAO提案在泰国曼谷开设无聊猿主题饭店!APE支付房费、赋能BAYC

    2025-10-29347阅读

  • NFT回温?Mocaverse地板价突破2.9ETH 24小时涨幅高达79%

    NFT回温?Mocaverse地板价突破2.9ETH 24小时涨幅高达79%

    2025-10-29311阅读

  • 公链Hyperliquid上首个AI代理Liquina将空投NFT!发放给$LQNA持有者

    公链Hyperliquid上首个AI代理Liquina将空投NFT!发放给$LQNA持有者

    2025-10-29332阅读

  • 首支NFT概念ETF在美上市!由Defiance推出 追踪NFT相关公司

    首支NFT概念ETF在美上市!由Defiance推出 追踪NFT相关公司

    2025-10-29326阅读

  • 虚拟货币交易平台有哪些?2025最新加密货币交易所排名与推荐

    虚拟货币交易平台有哪些?2025最新加密货币交易所排名与推荐

    2025-10-29307阅读

  • Polymarket暗示发币,一文盘点10个生态项目

    Polymarket暗示发币,一文盘点10个生态项目

    2025-10-29329阅读

  • Dexscreener 是什么?有什么功能? 一文介绍

    Dexscreener 是什么?有什么功能? 一文介绍

    2025-10-29318阅读

  • 什么是Solana失败交易?Solana交易失败的修复策略

    什么是Solana失败交易?Solana交易失败的修复策略

    2025-10-29300阅读

  • 什么是加密货币空投?如何运作?加密货币空投安全吗?

    什么是加密货币空投?如何运作?加密货币空投安全吗?

    2025-10-29313阅读

  • 什么是代币?如何运作?为什么代币很重要?

    什么是代币?如何运作?为什么代币很重要?

    2025-10-29248阅读

  • 精选专题