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


  1. Posts : 5
    Windows 7 Ultimate x64
       #1

    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
    Last edited by Nuc1eaR; 03 May 2015 at 21:08.
      My Computer


  2. Posts : 1,025
    Linux Lite 3.2 x64; Windows 7, 8.1
       #2

    Pretty straightforward using an autoit script.
      My Computer


  3. Posts : 5
    Windows 7 Ultimate x64
    Thread Starter
       #3

    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 Computer


  4. Posts : 5
    Windows 7 Ultimate x64
    Thread Starter
       #4

    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


  5. Posts : 1,025
    Linux Lite 3.2 x64; Windows 7, 8.1
       #5

    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


  6. Posts : 5
    Windows 7 Ultimate x64
    Thread Starter
       #6

    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 by Nuc1eaR; 05 May 2015 at 18:24.
      My Computer


  7. Posts : 5
    Windows 7 Ultimate x64
    Thread Starter
       #7

    Done. Thanks a lot paul.

    /close
      My Computer


  8. Posts : 1,025
    Linux Lite 3.2 x64; Windows 7, 8.1
       #8

    YW. Glad it worked for you.
      My Computer


  9. Posts : 4
    Windows7
       #9

    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


 

  Related Discussions
Our Sites
Site Links
About 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 20:39.
Find Us