12

I'm trying to write a remote window manager so that I can control my open windows via bluetooth using anyremote. There's wmctrl for Linux that manages windows from the command line. Is there similar tool in Microsoft Windows? I.e. A command line based window manager for Microsoft Windows.

If there are existing command line hacks that I could use to get the list of open windows, and bring a certain window to the front and give it focus, let me know.

3 Answers 3

12

NirCmd by Nir Sofer is a command-line tool which can manipulate windows in all sorts of ways.

It can also automate dozens of other little tasks, like shutdown, shortcuts, screenshots, volume control. A proper Swiss-army knife of a tool.

The general format of the window manipulation commands is

nircmd win show/hide/min/max/center/close title "Window Title"

but there's a whole lot more you can do.

1
  • In my case, I've typed this command in cmd title A; I've open another cmd, and typed this command nircmd win close title "A"; Not working though
    – mr5
    Aug 27, 2015 at 2:58
2

Windows, like Unix, has multiple shells. "CMD.EXE" is by far the best known, but PowerShell is far more capable. It's built on top of .NET, and therefore can easily manipulate windows. See https://stackoverflow.com/questions/4993926/maximize-window-and-bring-it-in-front-with-powershell for an example.

1

An alternative to PowerShell and NirCmd is of course JP Software's TCC/LE and TakeCommand.

They have the ACTIVATE command, that can do on Win32 pretty much all of the minimize/maximize/top/bottom/pos/close stuff that wmctrl does for X. Of course, some wmctrl mechanisms have no meaning on Win32 and no equivalents for ACTIVATE. Conversely, ACTIVATE can do some Win32 things that wmctrl has no functions for, such as manipulation of the z order, use of the taskbar, flashing, and modification of the "topmost" flag.

They also have the KEYSTACK command that can be used to send simulated keyboard input to windows.

1
  • 1
    wmctrl can set above and below.
    – peth
    Dec 20, 2012 at 17:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .