5,593,876 Members 46,961 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
Talderon
Old
#1  
Talderon's Avatar
Senior Member - OP
Thanks Meter 120
Posts: 1,144
Join Date: Sep 2008
Location: Seattle

 
DONATE TO ME
Service [SCRIPT] Create Shutdown, Logoff and Reboot buttons on Start Screen

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!
Talderon

_____________________________________________
DEVICE: Nokia Lumia 920 (Yellow)
STATUS: STOCK
ROM: STOCK
NETWORK: AT&T LTE US (Puget Sound Area, Washington)

Professional Web Design
_____________________________________________
DropBox! 2GB Free and can get more space FREE!
Read here: http://db.tt/rJoFjP7
The Following 14 Users Say Thank You to Talderon For This Useful Post: [ Click to Expand ]
 
androidjel
Old
#2  
Senior Member
Thanks Meter 31
Posts: 354
Join Date: Apr 2012
Tnx im gonna try and report if it worked

Sent from my LG-P970 using xda premium
 
androidjel
Old
#3  
Senior Member
Thanks Meter 31
Posts: 354
Join Date: Apr 2012
It works

Sent from my LG-P970 using xda premium
 
budgreen24
Old
#4  
budgreen24's Avatar
Member
Thanks Meter 43
Posts: 93
Join Date: Sep 2011
Location: Long Beach
I tried this and it works. Thanks.

Sent from my HERO200 using xda app-developers app
 
Tubes6al4v
Old
#5  
Tubes6al4v's Avatar
Senior Member
Thanks Meter 81
Posts: 278
Join Date: Oct 2009
Great Job, thanks, this will make it a bit more intuitive Here is a photo of the icons:

Having Battery issues? Try my Guide

Phone: Galaxy Nexus GSM (AOKP, franco.kernel, IPv6, Days of battery )

Tablet: Galaxy Tab 10.1 Wifi (AOKP 4.0.3)
 
KcLKcL
Old
#6  
KcLKcL's Avatar
Senior Member
Thanks Meter 140
Posts: 576
Join Date: Dec 2011
Location: Jakarta
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
Samsung Galaxy Ace > Samsung Galaxy S2 > Nexus 4
 
CRDeveloper
Old
#7  
Junior Member
Thanks Meter 0
Posts: 9
Join Date: Apr 2011
Location: San Jose
Quote:
Originally Posted by KcLKcL View Post
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
 
KcLKcL
Old
#8  
KcLKcL's Avatar
Senior Member
Thanks Meter 140
Posts: 576
Join Date: Dec 2011
Location: Jakarta
Quote:
Originally Posted by CRDeveloper View Post
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
Samsung Galaxy Ace > Samsung Galaxy S2 > Nexus 4
 
*Detection*
Old
#9  
*Detection*'s Avatar
Senior Member
Thanks Meter 463
Posts: 1,974
Join Date: 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
Droid: TF101
HW: B4O
ROM: KatKiss KitKat



KatKiss Dev / Stable
Kat Kernel
Kat App
Gapps
 
kyawswaraung
Old
#10  
kyawswaraung's Avatar
Senior Member
Thanks Meter 22
Posts: 112
Join Date: 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.
Sorry for my poor language

Don't forget to hit Thanks if I help you

>>>>>>>>>>>>>>>My Devices<<<<<<<<<<<<<<<

- iPhone 4S
- P6200 Galaxy Tab 7 plus
- Xperia Arc S (already sold)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

How to Hack An Android App (Don’t Try This at Home) – XDA Developer TV

Listen, don’t cheat in your games. So don’t … more

Windows Phone 8.1 Developer Preview Now Available!

About two weeks ago at the BUILD conference in San Francisco, Microsoft unveiled Windows … more

Prevent Unwanted Butt Dialing with Smart Pocket Guard

You may recall that back in August of last year, we took a look atAir SwiperbyXDA … more