desktop icon for hibernate in windows 7

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.
sappledoAsked:
Who is Participating?
 
greyknight17Commented:
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
 
greyknight17Commented:
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
 
sappledoAuthor Commented:
easy to do
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.