I have a batch file opening several notepad documents in specific locations. I am changing the windows registry before every document so it will open in the location desired and with the sized desired. While all windows open in the desired location not all of them open with the desired size. example:

reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDX /t REG_DWORD /d 1402 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDY /t REG_DWORD /d 682 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosX /t REG_DWORD /d 4294965889 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosY /t REG_DWORD /d 585 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v fWrap /t REG_DWORD /d 0 /f

start "" "file1.txt"

rem *****

reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDX /t REG_DWORD /d 674 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDY /t REG_DWORD /d 837 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosX /t REG_DWORD /d 4294966192 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosY /t REG_DWORD /d 219 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v fWrap /t REG_DWORD /d 1 /f

start "" "file2.txt"

rem *****

reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDX /t REG_DWORD /d 540 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDY /t REG_DWORD /d 837 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosX /t REG_DWORD /d 4294965665 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosY /t REG_DWORD /d 219 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v fWrap /t REG_DWORD /d 0 /f


start "" "file3.txt"

Most of the time file #1 will have a different size, sometimes it will have the correct size. File 2 for the most always has the right size and file 3 I dont recall a time the size was wrong.

However, if I cut and paste to a cmd window any of those commands they files always open in the right place and right size....

I have attempt to slow down the speed at which the block of commands but still the same outcome.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.