Set (Many) Programs' Window Size/Position

11

2

I'm looking for a solution similar to this, but for Windows 7 (64-bit), and not just for the terminal. This is also definitely not a duplicate of this question.

The Problem

Some programs remember their last position/size (e.g. Firefox, Notepad++), while others are unfortunately stubborn (e.g. Git). The stubborn ones require me to spend an extra minute (so long, right?) moving them back to their desired positions/sizes before I can start working.

Use Case

I'm a programmer, and I have a very specific preference for my development environment. I have two monitors, and have my IDE (varies by the task), Git terminal, Windows Explorer window, Firefox, etc. open all at once, in a specific layout that helps me work more efficiently.

Environment-Based Auto-Setup

Ideally, I could open all of these programs, and press a hotkey combination to throw all of the windows into their desired positions with the correct sizes. Or even more ideally, have a set of settings (scripts, hotkey combinations, etc.) that I could run in certain scenarios to open a set of specific programs depending on the task (may be asking too much), and set that specific layout.

Example: a C# development script that opens Visual Studio and many other programs, then sets their window locations appropriately. Another for Node.js development.

Tools For The Job?

I only have some vague ideas of the capabilities of certain tools. Maybe Windows Power Shell would be appropriate? I wouldn't mind writing scripts for these tasks. Auto Hotkey also seems like it might work.


Does anyone have any experience with this kind functionality and have any recommendations as to how to go about something like this? The ability to run a script/hotkey to open a set of programs and set all sizes/positions automatically would be best, if possible.

Note: I tagged this as powershell and autohotkey just in case those tools very well apply to the task. If you feel this is tagged incorrectly, please feel free to remove/re-tag!

Chris Cirefice

Posted 2014-06-16T19:42:53.197

Reputation: 267

I'll take a look at it when I have some spare time - when I come up with a solution here, I'll post it as an answer. Maybe someone will find it useful :) – Chris Cirefice – 2014-06-19T19:28:35.570

I believe AutoHotkey can in fact grab windows and set their positions. If you are looking for a more easy-to-use system, try getting AutoHotkey_L along with Macro Creator v4.1.1. – Stonestorm – 2014-06-16T19:51:29.497

That's what I'm thinking, but before I get into trying to set up scripts for that program, I'd like to make sure that it can handle all of the tasks that I have in mind. But just doing a simple Google search, it seems like Auto Hotkey may just solve my problem... WinMove is apparently a function that can be called. Looks appropriate, I must say :)

– Chris Cirefice – 2014-06-16T19:53:45.770

1Having used both PowerShell and AutoHotKey, the latter is the better solution for this task. Their documentation is pretty decent as well. – Tim Ferrill – 2014-06-16T20:10:45.610

Answers

8

You could use the PowerShell UIAutomation module.

For example, to move Notepad to screen location (100, 100):

$w = Get-UIAWindow -ProcessName notepad
$w.Move(100, 100)

dangph

Posted 2014-06-16T19:42:53.197

Reputation: 3 478

I installed the module but it says "Castle.Proxies.UiElementProxy_1 does not contain method Move" – Eduardo Wada – 2015-02-11T12:44:44.387

I prefer the AutoIt Cmdlets for PowerShell these days.

– dangph – 2015-12-20T14:37:15.430

0

You also could try TaskLayout tool (not a freeware) which offers user-friendly way to create such layouts without scripting/programming.

TaskLayout is a small portable Windows utility which allows to save/restore the desktop layout(a set of specified apps/windows with corresponding position on screen) in a single click.

The application can save different desktop layout files, run them and restore the windows that were active at that moment. The layout editor helps you to choose several of the opened windows and save the configuration in a file. Whenever you require restoring the window having the location or a specific path, just run the file. The application can restore the opened window to the state in which you stored them.

Clance

Posted 2014-06-16T19:42:53.197

Reputation: 1

Please see How do I recommend software in my answers?

– Scott – 2017-02-08T09:42:59.833