How can a batch file run a program and set the position and size of the window?

前端 未结 6 743
半阙折子戏
半阙折子戏 2020-11-28 06:18

I have batch file that sets up the desktop environment for me when I am writing code. The file is named: SetEnv.cmd and it opens 3 other windows:

6条回答
  •  情深已故
    2020-11-28 06:40

    As an alternative, I'd suggest using AutoHotKey, which would easily handle this (better than Powershell and Batch, in my opinion).

    As a simple sample, to launch the two instances of Explorer, resize (and move) them, then do the same with the cmd window you might do something like this:

    Run Explorer /n,c:\develop\jboss-4.2.3.GA\server\default\deploy
    Run Explorer /n,c:\develop\Project\Mapping\deploy
    WinMove, deploy, server\default, 0, 0, 200, 200
    WinMove, deploy, Project\Mapping, 200, 0, 200, 200
    Run cmd /c SetupEnvCmd.cmd
    WinMove, C:\develop\jboss-4.2.3.GA\bin, 0, 200
    

    WinMove Help Doc

提交回复
热议问题