Automatically Position Application Window Using Command File in Windows

梦想与她 提交于 2019-12-24 00:28:35

问题


I'm using PuTTY to access my BSD file server and I have several terminal windows open at once. I wrote a simple command file to automate opening the terminal windows and I'd like to know if it is possible to place them at a specific location.

I have two monitors and as it is now, I have to manually drag the terminal windows over to my second monitor.


回答1:


AFAIK you can't do it directly from a batch file without using some 3rd party software like AutoHotkey.

It makes it incredibly easy to move a window. For example this script would start Calculator and move it to the top-left corner:

Run, calc.exe
WinWait, Calculator
WinMove, 0, 0

You can also easily compile your script into an .exe if you want to share it with other people that don't have AHK installed. It will basically answer all your automation needs, just as it has done mine :)



来源:https://stackoverflow.com/questions/1147949/automatically-position-application-window-using-command-file-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!