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

前端 未结 6 748
半阙折子戏
半阙折子戏 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条回答
  •  Happy的楠姐
    2020-11-28 06:47

    Check out StartX. I haven't used it, but it looks like you can use it to launch an application with a specific position and size.

    StartX, a very simple utility to allow you to call the CreateProcess API from the command line.

    Some of its commandline parameters:

    StartX ["title"] [/Dpath] [/MIN] [/MAX] [/Px,y] [/Scx1,cy1]
    

    x,y: Specifies the x and y offset, in pixels, of the upper left corner of a window if a new window is created. The offset is from the upper left corner of the screen.

    cx1, cy2: Specifies the width and height, in pixels, of the window if a new window is created.

提交回复
热议问题