Hello i am trying to have a batch file that minimizes all other windows other than itself. also if possible have it be selected so you can type into it.
TLDR: make batchfile only thing on screen
P.s: vbscrips won't work to send windows key + Home it doesn't support winkey and even if it did it wouldn't work if some thing else was selected
62 Answers
Since you said you're OK with launching a second batch file in the new window, you can easily accomplish this with no third-party software - you can use PowerShell!
This command minimizes all windows:
(New-Object -ComObject Shell.Application).MinimizeAll()And this executes the second batch file (e.g. myfile.bat) in a new maximized window:
Start-Process myfile.bat -WindowStyle MaximizedYou can run those two PowerShell commands with this batch command (I've golfed them a bit for faster typing):
powershell -command "(new-object -com shell.application).minimizeall();start myfile.bat -window Maximized" 3 I am trying to have a batch file that minimizes all other windows other than itself
You can use nircmd from nirsoft to do this.
Command line:
nircmd sendkeypress rwin+homeBatch file:
@echo off
setlocal
nircmd sendkeypress rwin+home
endlocalNotes:
- Put
nircmdsomewhere in yourPATHor use the full name in the batch file.
NirCmd Command Reference - sendkeypress
sendkeypress [Keys Combination 1] [Keys Combination 2] [Keys Combination 3] ...Sends one or more key press combinations to the system. The operating system will behave exactly as the user really pressed the specified keys combination.
The [Key Combination] parameter specifies a single key press to send or a combination of a single key and shift/ctrl/alt/Windows keys, delimited by '+' character.
The key in the [Key Combination] parameter can be specifed as numeric virtual key code (For example: 0x2e for Delete key), or as one of the following predefined values: a - z and 0 - 9 (for alphanumeric keys), F1 - F24 (for Fxx keys), shift, ctrl, alt, enter, esc ,leftshift, rightshift, leftctrl, rightctrl, leftmenu, rightmenu, spc (space), down, up, left, right, home, end, insert, delete, plus, comma, minus, period, lwin, rwin (Windows key), apps, pageup, pagedown, tab, multiply, add, subtract, separator, divide, backspace, pause, capslock, numlock, scroll, printscreen.
Source NirCmd Command Reference - sendkeypress
What is nircmd?
NirCmd is a small command-line utility that allows you to do some useful tasks without displaying any user interface. By running NirCmd with simple command-line option, you can write and delete values and keys in the Registry, write values into INI file, dial to your internet account or connect to a VPN network, restart windows or shut down the computer, create shortcut to a file, change the created/modified date of a file, change your display settings, turn off your monitor, open the door of your CD-ROM drive, and more...
Source nircmd
Disclaimer
I am not affiliated with nirsoft in any way, I am just an end user of the software.
4