FORUMS

Optimize Battery Life with This Useful App

Battery life is an important aspect of your smartphone, especially if you use it for more … more

The OnePlus 2 & The Year of Smartphone Compromises

We are very close to entering the last third of 2015, and we have now seen many of … more

OnePlus 2 Teardown, Major Android Vulnerability – XDA TV

The OnePlus 2 has been officially released. That and much more news is … more

What Do You Think About Fingerprint Scanners?

More and more phones are featuring fingerprint scanners, and with many promising … more

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

1,145 posts
Thanks Meter: 120
 
Post Reply Subscribe to Thread Email Thread
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, 08:35 AM |#2  
Senior Member
Thanks Meter: 33
 
More
Tnx im gonna try and report if it worked

Sent from my LG-P970 using xda premium
21st September 2012, 12:48 PM |#3  
Senior Member
Thanks Meter: 33
 
More
It works

Sent from my LG-P970 using xda premium
22nd September 2012, 08:53 PM |#4  
budgreen24's Avatar
Member
Flag Long Beach
Thanks Meter: 51
 
More
I tried this and it works. Thanks.

Sent from my HERO200 using xda app-developers app
23rd September 2012, 04:38 AM |#5  
Tubes6al4v's Avatar
Senior Member
Thanks Meter: 82
 
More
Great Job, thanks, this will make it a bit more intuitive Here is a photo of the icons:

23rd September 2012, 04:45 AM |#6  
KcLKcL's Avatar
Senior Member
Flag Jakarta
Thanks Meter: 303
 
Donate to Me
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, 07:49 AM |#7  
Junior Member
Flag San Jose
Thanks Meter: 0
 
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, 04:01 PM |#8  
KcLKcL's Avatar
Senior Member
Flag Jakarta
Thanks Meter: 303
 
Donate to Me
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, 01:52 PM |#9  
*Detection*'s Avatar
Senior Member
Flag Durham
Thanks Meter: 839
 
Donate to Me
More
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, 05:14 AM |#10  
kyawswaraung's Avatar
Senior Member
Thanks Meter: 22
 
More
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.
7th November 2012, 12:58 PM |#11  
Fabri181818's Avatar
Senior Member
Flag Friuli (near Venice)
Thanks Meter: 20
 
More
Quote:
Originally Posted by kyawswaraung

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.

you can found file here http://forum.xda-developers.com/show...&postcount=206

or you have to copy and paste the code in your note pad and save it as .vbs file and then double click on it

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

Advanced Search
Display Modes