Friday, July 20, 2012

Add Shortcuts in Windows 8 for Shutdown and Restart

I have been using Windows 8 as my primary OS since the past week and am overall quite happy with the various UI improvements. The Metro Tiles interface is primarily designed for the touch screen but it’s equally easy to navigate with a mouse and keyboard.
They got rid of the Start Menu in Windows 8 and as a side-result, there’s no dedicated menu option available to quickly shut-down or restart your Windows 8 computer.
shutdown windows 8

How to Shutdown, Restart or Log Off in Windows 8

The regular approach I this. As there are no “shutdown” buttons in Windows 8, you can switch to the desktop view and press Alt+F4 to bring the Shut Down menu or the other option is that you press the shortcut key Win+C, go to Settings – > Power – > Shut down.
That’s too many steps especially when you are in a dual-boot environment and need to switch from one OS to another.

Wouldn’t it more convenient if you could create simple tiles – like any other metro app – and place them on the Windows 8 desktop so that you can Shut down, Log off or Restart your Windows 8 computer with a simple click (or tap).
Enter createButtons.vbs – this is a simple utility (or rather a script) that will automatically add Shut Down and other related buttons to your Windows 8 screen. There’s no installation required – just download the file to your desktop and double-click to create the various buttons.

Now you Have to make a Simple Programming as createButtons.vbs File 

Now Copy the Coding and paste it into Notepad
'
' This script will create shortcuts in the Start Menu
' Written by Suryansh Mishra - 06/03/2012
' Web: http:suryanshhacker.blogspot.com
' Version: 0.1
'
set WshShell = WScript.CreateObject("WScript.Shell")
strStartMenu = WshShell.SpecialFolders("StartMenu")
set oShellLink = WshShell.CreateShortcut(strStartMenu & "\Shutdown.lnk")
oShellLink.TargetPath = "%systemroot%\System32\shutdown.exe"
oShellLink.Arguments = "-s -t 0"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%systemroot%\System32\shell32.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%\System32\shutdown.exe"
oShellLink.Arguments = "-l"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%systemroot%\System32\shell32.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%\System32\shutdown.exe"
oShellLink.Arguments = "-r -t 0"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%systemroot%\System32\shell32.dll,176"
oShellLink.Description = "Restart Computer (Reboot)"
oShellLink.WorkingDirectory = "%systemroot%\System32\"
oShellLink.Save
Set oShellLink = Nothing
Wscript.Echo "Created Shutdown, Restart and Log Off buttons"
 and Now if you are done with Copying it to notepad then save it as Createbuttons.vbs


Remember: To save the Coding in .vbs not in .txt
Any question or facing difficulties Comment!!

No comments:

Post a Comment