Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: set window height/width/position via .bat or shortcut parameters

03 May 2015   #1
Nuc1eaR

Windows 7 Ultimate x64
 
 
set window height/width/position via .bat or shortcut parameters

Hi all!

I - as my dayjob - am programming CNC-machines. From time to time get an idea for some code that i want to try out at home. For that reason i want a simple way to sart up everything i need and get going right away.

In particular that would be:
  • the emulation software of the machine
  • the manual of the machine (.pdf)
  • a picture of the american keyboard-layout (.jpg) [i'm german ]
  • sth. to make notes - i use MS Excel (.xlsx)
But since i use this PC for all sorts of things in between 2 projects, it is very likely that i messed up window sizes and positionings.

I would like to hard-set these values somewhere, so that whatever is saved up from previous uses gets overwritten.

My attempt to achieve this was to create a simple .bat-file that starts all of these:
Code:
start "" "G:\UVA\startupHome\737_759-11"      //manual
start "" "G:\UVA\startupHome\Gravurzyklus"    //notes
start "" "G:\UVA\startupHome\tasta-pgmplatz"  //keybord-layout
start "" "C:\Programme\iTNC530\itncstart.bat" //emulator
exit
The first 3 are linking to shortcuts so that i can add in parameters to run with every file.

I added in
Code:
"C:\ [...] \AcroRd32.exe" /A "zoom=75&page=310" "G:\ [...] \737_759-11.pdf"
for the .pdf-file at the extension to start at the part that is of interest.

What i would need now is the ability to set height, width, x- and y-coordinates for all of these windows except the "itncstart.bat" (basically positioning everything else around that one).

Is something like this possible? I would prefer not to use additional 3rd-party software.

I'm using Windows 7 Ultimate (64) with a 2-monitor setup.

Thanks in advance!
greetz

Nuc

PS: If something is unclear, dont be afraid to ask. I'll try to rephrase then


My System SpecsSystem Spec
.
03 May 2015   #2
paul1149

Linux Lite 2.8 x64 (full-featured, fast, rock-solid)
 
 

Pretty straightforward using an autoit script.
My System SpecsSystem Spec
03 May 2015   #3
Nuc1eaR

Windows 7 Ultimate x64
 
 

Will look into that - thanks paul

Im not marking this as solved yet until i actually have it up and running.
Therefore if others want to post more possible options i'll be glad to hear more
My System SpecsSystem Spec
.

05 May 2015   #4
Nuc1eaR

Windows 7 Ultimate x64
 
 

I've just found time to read a bit into that 'autoit'-stuff.
Their documentation seems a bit all over the place tbh.

But before i spend more time on that and just to make sure, a thing like:
Code:
-w800 -h400 -x0 -y0
to add to the shortcut does not exist, right?
My System SpecsSystem Spec
05 May 2015   #5
paul1149

Linux Lite 2.8 x64 (full-featured, fast, rock-solid)
 
 

In Windows? I don't know. I've never come across it. I know it's in the OS, because some progs give you the choice of centering the window, remembering the last position, etc. But I've never seen it in a shortcut.

In AutoIt, it looks something like this:

Code:
run ( "C:\Program Files\Games\FREECELL.EXE" )
WinWaitActive ( "FreeCell")
winactivate ("FreeCell")
winmove ( "FreeCell","", 0,430,650,500 )
exit
My System SpecsSystem Spec
05 May 2015   #6
Nuc1eaR

Windows 7 Ultimate x64
 
 

Wow - that was a quick response!

Thanks for the answer - and that example is much appreciated as well

Edit: I should have installed it first and checked the perfectly good help that comes with the program instead of getting information out of their forums. I really should have.
My System SpecsSystem Spec
08 May 2015   #7
Nuc1eaR

Windows 7 Ultimate x64
 
 

Done. Thanks a lot paul.

/close
My System SpecsSystem Spec
08 May 2015   #8
paul1149

Linux Lite 2.8 x64 (full-featured, fast, rock-solid)
 
 

YW. Glad it worked for you.
My System SpecsSystem Spec
25 May 2015   #9
sapsan

Windows7
 
 

Just a little note. There is an alternative to AutoIt scripting: a portable handy tool TaskLayout. It will automatically save and restore your applications with corresponding screen position whenever you need it.
My System SpecsSystem Spec
Reply

 set window height/width/position via .bat or shortcut parameters




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Find image files with SAME width and height
I'm trying to find images with equal width and height in Windows 7 I tried: width: it does not work. Any idea ?
General Discussion
Creating shortcut with parameters
Hey guys I want to create a shortcut to my folder with parameters. When I enter the folder from the shortcut I want to see the files that has username/UNWATCHED ownership. I can manually select this from the folder's owner tab. But I want direct access from shortcut.
General Discussion
Window width restricted to 1920px (one display width)
Guys, strange issue here, started lately - not sure when exactly, though, probably a couple of weeks maybe four. I can't make a window wider than about one screen width - 1920px - Windows just won't let me. (it can partially extend to other screens, but the total window width remains) It used...
Graphic Cards
How to decrease width/height of descriptions on desktop
Hi guys, You solved one problem for me: size of icons - now need to decrease the space between entries. Cheers, ARRGGHH! Just downloaded updates for my SAMSUNG R780 Laptop got trashed and now only option is generic VGA Adaptor.
General Discussion
How to increase width and height windows sidebar Feed Headlines?
Hi! Anybody know how to increase width and height windows sidebar default "Feed Headlines" gadget?
Gadgets
Desktop display not extending full monitor width/height
Just updated from Vista 64 to Windows7 64 build7100 . Using DellWFP 32" monitor and ATI v7200 video card. My desktop will not extend all the way left to right or top to bottom on my monitor. It has black bar around desktop extending to edges of monitor. When I set screen resolution to...
Graphic Cards


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:56.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App