Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Talderon
Old
#1  
Talderon's Avatar
Senior Member - OP
Thanks Meter 120
Posts: 1,142
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: 285
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: 285
Join Date: Apr 2012
It works

Sent from my LG-P970 using xda premium
 
budgreen24
Old
#4  
budgreen24's Avatar
Member
Thanks Meter 24
Posts: 63
Join Date: Sep 2011
Location: LB, CA
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 130
Posts: 557
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
 
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 130
Posts: 557
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
 
*Detection*
Old
#9  
*Detection*'s Avatar
Senior Member
Thanks Meter 217
Posts: 1,132
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
WP7.8: Nokia Lumia 710
HW: 112.1402.2.1
ROM: Stock 7.10.8862.144

---
Droid: TF101
HW: B4O
ROM: Team EOS JellyBean



TeamEOS4 Nightlies
TeamEOS4 Previews
Kat Kernel
Kat App
 
kyawswaraung
Old
#10  
kyawswaraung's Avatar
Senior Member
Thanks Meter 22
Posts: 111
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)

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Auto Test Your Android Apps with Robotium

You’ve just finished coding your very first app, but before you release it to the wild, you … more

Open Source CPU Info App for Windows

So you’re playing with your shiny new Windows 8 tablet PC, when one of your like-minded geeky … more

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more