Добавление плитки выключения и перезагрузки

Тема в разделе "Статьи для портала", создана пользователем BigStone, 25 дек 2012.

  1. BigStone

    BigStone Ушла гулять,и заблудилась. Команда форума Админ

    Регистрация:
    23 ноя 2012
    Сообщения:
    672
    Симпатии:
    572
    Баллы:
    93
    Добавление плитки выключения и перезагрузки для стартового экрана на ваш Windows 8 или Windows, RT

    For most of us on Windows 8, we simply hit Win+C to bring up the Charms bar, hit Settings, then power, then we shut down our PC. But for those who are on a tablet device running Windows 8 or Windows RT, perhaps there's an easier way to shutdown or restart. Well, there is. If you want to create a shutdown and reboot tile in your Start Screen for easy access to these useful system commants, read along.

    Simply copy the following code into a new txt file and rename it to whatever you like, just add the .vbs to the file extension. For example: shutdown.vbs. Once this is done, simply double click the script and it will create the tiles for you. If you are unable to create a .vbs document, make sure you have "show file names extensions" enabled in Folder Options within Windows 8.

    Код:
        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)."
     
  2. arseny92

    arseny92 Старожил Команда форума Супер модератор

    Регистрация:
    24 ноя 2012
    Сообщения:
    340
    Симпатии:
    826
    Баллы:
    93
    Пол:
    Мужской
    Адрес:
    Israel
    [quote author="BigStone"]
    Добавление плитки выключения и перезагрузки для стартового экрана на ваш Windows 8 или Windows, RT

    For most of us on Windows 8, we simply hit Win+C to bring up the Charms bar, hit Settings, then power, then we shut down our PC. But for those who are on a tablet device running Windows 8 or Windows RT, perhaps there's an easier way to shutdown or restart. Well, there is. If you want to create a shutdown and reboot tile in your Start Screen for easy access to these useful system commants, read along.

    Simply copy the following code into a new txt file and rename it to whatever you like, just add the .vbs to the file extension. For example: shutdown.vbs. Once this is done, simply double click the script and it will create the tiles for you. If you are unable to create a .vbs document, make sure you have "show file names extensions" enabled in Folder Options within Windows 8.

    Код:
        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)."
    [/quote]
    those who are on a tablet device running Windows 8 or Windows RT can just swipe in from the right edge of the screen to bring up Charms.
     
  3. Softservice

    Softservice Ветеран Команда форума Админ

    Регистрация:
    23 ноя 2012
    Сообщения:
    1.596
    Симпатии:
    1.125
    Баллы:
    113
    Сайт:
    Многие, для выключения компьютера вызывают сочетанием клавиш Win+C чудо панель. Нажимают чудо кнопку параметры и выбирают выключение(завершение работы). Для планшетов это может быть не совсем удобно. Нужна плитка. Раз нужна, значит нужна, создаём плитку.

    Нам потребуется скопировать нижеприведённый код в файл с именем например shutdown.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)."
    Получаем вот такое сообщение:
    [​IMG]

    И можем пользоваться нашими удобными кнопками.
    [​IMG]

    * Не забудьте настроить проводник для отображения расширений файлов.
     
  4. Softservice

    Softservice Ветеран Команда форума Админ

    Регистрация:
    23 ноя 2012
    Сообщения:
    1.596
    Симпатии:
    1.125
    Баллы:
    113
    Сайт:
  5. grinyaulis

    grinyaulis Добро-Вредный

    Регистрация:
    2 дек 2012
    Сообщения:
    4.156
    Симпатии:
    247
    Баллы:
    63
    Пол:
    Мужской
    Адрес:
    Пермь
    Спасибо. Работает.
     
Letyshops

Поделиться этой страницей