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

Nuc1eaR

New member
Local time
8:19 PM
Messages
5
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 :geek:]
  • 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" [B]/A "zoom=75&page=310"[/B] "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 :D
 
Last edited:

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Pretty straightforward using an autoit script.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
dell precision t3400 tower
OS
Linux Lite 3.2 x64; Windows 7, 8.1
CPU
Core2Duo 2.4
Memory
6GB ddr2
Graphics Card(s)
nVidia
Hard Drives
120gb SSD, 1TB HD, 2TB HD; sata II
Internet Speed
12/2
Browser
Vivaldi, Slimjet (Chromium) x64
Will look into that - thanks paul :D

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 Computer My Computer

Computer type
PC/Desktop
OS
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 Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
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 Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
dell precision t3400 tower
OS
Linux Lite 3.2 x64; Windows 7, 8.1
CPU
Core2Duo 2.4
Memory
6GB ddr2
Graphics Card(s)
nVidia
Hard Drives
120gb SSD, 1TB HD, 2TB HD; sata II
Internet Speed
12/2
Browser
Vivaldi, Slimjet (Chromium) 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.
 
Last edited:

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Done. Thanks a lot paul.

/close
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
YW. Glad it worked for you.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
dell precision t3400 tower
OS
Linux Lite 3.2 x64; Windows 7, 8.1
CPU
Core2Duo 2.4
Memory
6GB ddr2
Graphics Card(s)
nVidia
Hard Drives
120gb SSD, 1TB HD, 2TB HD; sata II
Internet Speed
12/2
Browser
Vivaldi, Slimjet (Chromium) x64
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 Computer My Computer

Computer type
PC/Desktop
OS
Windows7
Back
Top