Would Someone Help Me with a Small .vbs script to Minimize Active Window?

Discussion in 'Windows 8' started by ChaserLee, Jan 7, 2015.

  1. ChaserLee

    ChaserLee MDL Senior Member

    Oct 7, 2014
    425
    91
    10
    #1 ChaserLee, Jan 7, 2015
    Last edited by a moderator: Apr 20, 2017
    I'm nowhere near a coder at all, so I thought that maybe one of you knowledgeable members would be willing to help me out?? I'm wanting a small, simple .vbs script that uses SendKeys to minimize any active window that happens to be on the desktop when the script is run. I have searched and found that the keyboard combination is Alt plus Space plus the N key in order to min any active desktop window in Windows 8.1 . I cannot use the Windows key in the application I need this script for, so it has to be the Alt and Space and N key combo.

    I just cannot seem to get the syntax correct for my sendkey. I've tried all kinds of combinations like %{SpaceN}, and % {Space}N, and on and on, but I just cannot get a script to work for me.

    I'm sure that to anyone who knows how to make vbs scripts, this would be child's play, but I know less than nothing about making even a simple script like what I need.

    So, I come with hat in hand, to ask for help. Would someone be so kind as to provide me with a small .vbs script that will completely minimize the currently active desktop window to the taskbar? I would be VERY grateful !!


    UPDATE: Nevermind, I finally figured it out. It was so simple, but like I said, I'm no coder... For anyone in the future who might need a simple script like this, the solution is as follows:

    Code:
    Set oShell = CreateObject("WScript.Shell")
    oShell.SendKeys "% n"
    Thanks to anyone who was interested enough to read this post with the intentions of helping!!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...