Reputation: 11
I am trying to find a way to adjust the window that opens while you are running a batch file WITHOUT using 3rd party programs. I have adjusted the size and color of it, but would like to move the window to the top left corner of the screen. This also has to be self contained in the batch file it self(not right-clicking on title bar and changing the settings of window position that way).
So for example, I have a batch file that opens, you answer the questions it asks then it opens the required program to finish the tasks(such as logging you into putty). But then, I would like the batch window to move to top left(already adjusted size and color to make it more noticeable) so it's easier for the user to click on it to see the "codes" I added to it to use in putty.
This is going to be distributed to multiple users and we can't add 3rd party programs and I don't want to have to explain to everyone how to adjust how the window opens, I just want it to always open top left(no matter how the computers are set up).
Lastly, all PCs are running Windows 7 and thanks in advance for the help!
Upvotes: 1
Views: 3950
Reputation: 779
Run the batch file from Start-Run:
set title=COMMAND PROMPT
reg add "hkcu\console\%title%" /v WindowPosition /t REG_DWORD /d "0" /f
start "%title%" cmd "%~f0 %title%"
exit /b
Upvotes: 0