desktop icon for hibernate in windows 7

Posted on 2011-04-21
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?

Question by:sappledo
    LVL 15

    Accepted Solution

    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.
    LVL 15

    Assisted Solution

    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"
    End If

    Open in new window


    Author Closing Comment

    easy to do

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This is a little timesaver I have been using for setting up Microsoft Small Business Server (SBS) in the simplest possible way. It may not be appropriate for every customer. However, when you get a situation where the person who owns the server is i…
    New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
    This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
    This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now