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

batchwindows 7

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

Best Answer

  • 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"
    
  • Related Question