Google Glass-like Clip-On For Regular Glasses Developed by Sony

For the price of $2,000, a pair of glasses that can run apps, take pictures, … more

Micromax Takes OnePlus to Court! Android Wear Receives Lollipop – XDA TV

Android 5.0 Lollipop is available officially for the Moto 360! … more

Google Invites Selected Devs to Buy Project Tango Development Kit

Just about a month ago, the curious Project Tango development kit was … more

YU Yureka: Indian Handset with CyanogenMod

Thesoap opera involving Cyanogen Inc., OnePlus, and Micromax is one of the most talked about … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[SCRIPT] Create Shutdown, Logoff and Reboot buttons on Start Screen

OP Talderon

21st September 2012, 02:35 AM   |  #1  
Talderon's Avatar
OP Senior Member
Flag Seattle
Thanks Meter: 120
 
1,144 posts
Join Date:Joined: Sep 2008
Donate to Me
More
So if you, or other users, need/want buttons to press to log off, reboot or shutdown their PC's from the start screen, this simple VBS script will make those for you in a quick run:

Save as a .vbs file and double click.

Code:
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 "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)."
Enjoy!
The Following 14 Users Say Thank You to Talderon For This Useful Post: [ View ]
21st September 2012, 09:35 AM   |  #2  
Senior Member
Thanks Meter: 32
 
366 posts
Join Date:Joined: Apr 2012
Tnx im gonna try and report if it worked

Sent from my LG-P970 using xda premium
21st September 2012, 01:48 PM   |  #3  
Senior Member
Thanks Meter: 32
 
366 posts
Join Date:Joined: Apr 2012
It works

Sent from my LG-P970 using xda premium
22nd September 2012, 09:53 PM   |  #4  
budgreen24's Avatar
Member
Flag Long Beach
Thanks Meter: 50
 
93 posts
Join Date:Joined: Sep 2011
More
I tried this and it works. Thanks.

Sent from my HERO200 using xda app-developers app
23rd September 2012, 05:38 AM   |  #5  
Tubes6al4v's Avatar
Senior Member
Thanks Meter: 81
 
278 posts
Join Date:Joined: Oct 2009
Great Job, thanks, this will make it a bit more intuitive Here is a photo of the icons:

23rd September 2012, 05:45 AM   |  #6  
KcLKcL's Avatar
Senior Member
Flag Jakarta
Thanks Meter: 281
 
685 posts
Join Date:Joined: Dec 2011
More
Ahh my friend always wondered how can they turn off my Win8 laptop lol. This might be handy. Thanks!

(I always told my friend to close the lid to hibernate my laptop lol)

Sent from my GT-I9100 using Tapatalk 2
23rd September 2012, 08:49 AM   |  #7  
Junior Member
Flag San Jose
Thanks Meter: 0
 
9 posts
Join Date:Joined: Apr 2011
More
Quote:
Originally Posted by KcLKcL

Ahh my friend always wondered how can they turn off my Win8 laptop lol. This might be handy. Thanks!

(I always told my friend to close the lid to hibernate my laptop lol)

Sent from my GT-I9100 using Tapatalk 2

So you haven't seen anything lol

Go to the right corner at the bottom, then go to settings and the power bottom will be right there. Most apps has settings and everytime you go there, different settings will be shown for the specific app
23rd September 2012, 05:01 PM   |  #8  
KcLKcL's Avatar
Senior Member
Flag Jakarta
Thanks Meter: 281
 
685 posts
Join Date:Joined: Dec 2011
More
Quote:
Originally Posted by CRDeveloper

So you haven't seen anything lol

Go to the right corner at the bottom, then go to settings and the power bottom will be right there. Most apps has settings and everytime you go there, different settings will be shown for the specific app

Lol I do know how to shutdown from the settings menu..

Sent from my GT-I9100 using Tapatalk 2
30th September 2012, 02:52 PM   |  #9  
*Detection*'s Avatar
Senior Member
Thanks Meter: 571
 
2,242 posts
Join Date:Joined: Dec 2011
Great job thanks, is there any way to chnage the restart icon to a higher image version ? seems lower rez than the other 2

---------- Post added at 01:52 PM ---------- Previous post was at 01:52 PM ----------

Great job thanks, is there any way to change the restart icon to a higher image version ? seems lower rez than the other 2
7th November 2012, 06:14 AM   |  #10  
kyawswaraung's Avatar
Senior Member
Thanks Meter: 22
 
112 posts
Join Date:Joined: Oct 2011
Can you guide how to save as .vbf file. I don't know how to apply your script. Please guide me as I'm a noob.
Thanks in advance, bro.

PS: I'm using window 8 with notebook.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes