Have a batch file minimize all windows but itself OR activate something that can

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 Maximized

You 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"

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+home

Batch file:

@echo off
setlocal
nircmd sendkeypress rwin+home
endlocal

Notes:

  • Put nircmd somewhere in your PATH or 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.