batch file to force program window locations and sizes?

I have a batch file that opens up 6 putty ssh sessions automatically.  I would like to be able to specify the exact location and size of each and every putty window on my desktop upon execution of the batch file.  I can do this in Unix X-Windows using special parameters to the "xterm" command, but have had no luck figuring it out in Windows XP either through batch commands or putty session settings.
skeedAsked:
Who is Participating?
 
sirbountyCommented:
Well, there's a SLEEP command in the windows environment as well - although it may be part of the resource kit.
Another trick some people use is a
Ping -N # 127.0.0.1 > nul
Replace # with the number of times you want it to ping (it's not 'exactly' a second per ping, but it's close)...

I did find the RKTools for Windows 2003 - sleep.exe should work for you from this package...
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
0
 
sirbountyCommented:
Without coding this in another programming language, I don't think you'll get what you're after.
The closest I think you could get, though not automated, would be to right-click your task bar and click Tile Windows vertically/horizontally...

One other method I can think of..
Go to %systemroot%\system32 folder
Duplicate the cmd.exe file 6 times (one for each instance of the bat file).
cmd1.exe, cmd2.exe, etc

Now click start/run/cmd1.exe
Move the window to where you want the first bat file to appear
Click the menu bar (where it looks like a small C:\ prompt window - upper left corner) and choose properties.
From the layout tab, deselect "Let system position window".  Click Ok - you'll be asked to apply the settings to current window only or save for future sessions (choose the latter obviously).  Now repeat these procedures to the other 5 cmd sessions.

Now, when you run your bat file, precede the call line with the appropriate command session (cmd1.exe mybat1.bat)
0
 
Eagle6990Commented:
I don't know exactly what layout you want, but once all 6 windows are opened, you can right click on an open area of the taskbar, or if the programs group together, you can right click on the group, and select tile horizontally or vertically to auto-position then on the screen.  I use this when opening pinging windows to all our routers.  Lets me see all the screens at once.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
skeedAuthor Commented:
Sirbounty,

Thanks for your suggestions.  However, when I precede either the batch file or the commands within the batch file with "cmd1.exe", it merely loads the command prompt and not my batch file or specifically putty.exe.  Am I doing something wrong?  Thanks.
0
 
sirbountyCommented:
You'll need to create a shortcut to putty.exe for each one.  Then edit the shortcut to precede it with CMD1 {path to putty}\putty.exe
0
 
sirbountyCommented:
You can also right-click the desktop/new shortcut and navigate to it.
Then right-click the shortcut and choose properties to edit it as above...you'll need to repeat this for each instance, obviously.
Don't hesitate to ask if you need further clarification... :D
0
 
skeedAuthor Commented:
Sirbounty,

I have created the shortcut with the Target defined as:

C:\WINDOWS\system32\cmdtest1.exe C:\putty\putty.exe

and upon double clicking on it, it still merely loads the dos command line.

Am I doing something wrong?  Thanks.
0
 
sirbountyCommented:
I think I misread your prior post - place cmd1.exe in front of your calling batch file...
You might even try this way CMD1 /K myfile.bat
0
 
skeedAuthor Commented:
Sirbounty,

I am able to get it to do what I want using the CMD1 /C command, for the most part.  For some reason, the windows don't appear in the exact same location that I had set for them, but they are spaced apart in the appropriate manner, which is the main thing I was going for.  

On a side note, do you know what the equivalent of the Unix "sleep" command is in Windows batch programming?  

I'm going to give you all the points I can for helping me on this.  Thanks immensely for your time and advice.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.