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:
- An instance of Windows Explorer that is set to the app server’s deploy directory.
- A second instance of Windows Explorer that is set to the directory where my deployment file is written.
- A console window to start my application server.
Here are the contents of SetEnv.cmd:
Explorer /n,c:\develop\jboss-4.2.3.GA\server\default\deploy
Explorer /n,c:\develop\Project\Mapping\deploy
cmd /c SetupEnvCmd.cmd
And here are the contents of SetupEnvCmd.cmd:
cd C:\develop\jboss-4.2.3.GA\bin
run
Every time I run this, I have to waste time rearranging and resizing the windows. I don’t want to run the windows minimized, because I interact with each window many times while writing and testing code. Is there any way I can control the position and/or size of the windows that are opened from within the script?
Try launching your programs from VBS (Windows Script Host) script via the batch file. If your VBS looks like this:
The
4means to launch the window in its most recent size/position.Falsemeans it won’t wait to return before executing the next line of your script. Unfortunately, this doesn’t give you full control of your exact window size/positioning, but it should remember last size/positioning.More info here: http://www.devguru.com/Technologies/wsh/quickref/wshshell_Run.html
So your new SetEnv.cmd could be: