[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

desktop icon for hibernate in windows 7

Posted on 2011-04-21
3
Medium Priority
?
476 Views
Last Modified: 2012-05-11
How do i make an icon on the desktop for windows 7?  is it difficult for me to do a "yes/no" question after I hit the icon to confirm my click?

thanks.
0
Comment
Question by:sappledo
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
greyknight17 earned 1000 total points
ID: 35445117
Right click on your desktop and go to New > Shortcut. Type in:

shutdown /h /f

Click Next and give it any name you want. Click Finish. The /f switch can be removed if you want. It will force close any open apps.

There is no way that I know to have the shortcut itself prompt you for a yes or no confirmation. You will need to use a batch file to do the prompting and have it run the shortcut if you type in Y/N.
0
 
LVL 15

Assisted Solution

by:greyknight17
greyknight17 earned 1000 total points
ID: 35445153
Create the shortcut as mentioned above with the shutdown command and /h (and /f switch if you want). Call it something like hibernate.

Now open up a new notepad file and copy/paste the code (see code field) into it. Save it as "hibernate.vbs" (make sure you keep the double quotes to force it to save as a VBS file). Put these two files (hibernate.lnk - shortcut you created, and hibernate.vbs) in the same folder or desktop.

Now just double click on hibernate.vbs file and you should get a prompt. Select No will just close the window. Clicking on Yes should put the computer into hibernation mode.
Set oShell = CreateObject("WScript.Shell") 

intAnswer = Msgbox("Go into hibernation?", vbYesNo, "Hibernate")

If intAnswer = vbYes Then
    oShell.Run "hibernate.lnk"
Else
    Wscript.Quit(0)
End If

Open in new window

0
 

Author Closing Comment

by:sappledo
ID: 35445607
easy to do
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question