8

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!

  • 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 Jun 16 '14 at 19:51
  • 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 Jun 16 '14 at 19:53
  • 1
    Having used both PowerShell and AutoHotKey, the latter is the better solution for this task. Their documentation is pretty decent as well. – Tim Ferrill Jun 16 '14 at 20:10
  • 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 Jun 19 '14 at 19:28
7

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)
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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.