Backup+ Lets You Backup Your App Data on Android Lollipop

Even though Android 5.0 Lollipop hasn’t yet seen its official release, quite … more

TechTalk Compiles All the Android News You Need in One App

If you’re as obsessed with mobile devices as the vast majority of our forum … more

Android App Review: Google Inbox to Improve Your Life – XDA TV

Recently, Google+ exploded with the announcement of Google Inbox, as … more

Damp the LG G3 Thermal Throttling

As our mobile devices grow thinner and more powerfulwith each passing generation, it’s inevitable … more
Post Reply

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

OP Talderon

21st September 2012, 01: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, 08:35 AM   |  #2  
Senior Member
Thanks Meter: 32
 
362 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, 12:48 PM   |  #3  
Senior Member
Thanks Meter: 32
 
362 posts
Join Date:Joined: Apr 2012
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: 49
 
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, 04: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, 04:45 AM   |  #6  
KcLKcL's Avatar
Senior Member
Flag Jakarta
Thanks Meter: 270
 
679 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, 07: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, 04:01 PM   |  #8  
KcLKcL's Avatar
Senior Member
Flag Jakarta
Thanks Meter: 270
 
679 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, 01:52 PM   |  #9  
*Detection*'s Avatar
Senior Member
Thanks Meter: 562
 
2,203 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, 05: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


Top Threads in Windows 8 Development and Hacking by ThreadRank