FORUMS

XDA Recap: This Week In Android (May 17 – 23)

Another week, another recap. The Sunday tradition marches on this week with a fresh … more

Huawei To Sell Honor Smartphones Via Indian Retail Outlets

World’s fourth largest smartphone maker Huawei plans to now sell its … more

Sunday Debate: Are Smaller Bezels Better or Worth It?

Bezels have been getting smaller and smaller as the years go by, and while devices … more

LG G4 First Impressions and Unboxing – XDA TV

The latest in LG’s signature line of “G phones” has been released. … more
Post Reply Subscribe to Thread Email Thread

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

21st September 2012, 01:35 AM |#1  
Talderon's Avatar
OP Senior Member
Flag Seattle
Thanks Meter: 120
 
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, 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: 81
 
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: 302
 
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: 302
 
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: 747
 
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.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Windows 8 Development and Hacking by ThreadRank