Page 1 of 1

i want to change position of batch file window. how?

Posted: 10 Feb 2012 16:38
by Mohammad_Dos
i want to change position of batch file window. how?

Re: i want to change position of batch file window. how?

Posted: 10 Feb 2012 16:43
by Ed Dyreen

Re: i want to change position of batch file window. how?

Posted: 11 Feb 2012 02:20
by Mohammad_Dos
is it possible without installing any app?

Re: i want to change position of batch file window. how?

Posted: 11 Feb 2012 03:10
by Judago
At invocation it's sort of possible. It's not a good solution....

Code: Select all

@echo off
set title=somewindowtitle
set xpos=150
set ypos=150
set /a "pos=(ypos << 16) + xpos"
if not "%~1"=="%title%" (
    >nul reg add "hkcu\console\%title%" /v WindowPosition /t REG_DWORD /d "%pos%" /f
    start "%title%" cmd /c "%~f0 %title%"
    goto :eof
)

reg delete "hkcu\console\%title%"
pause

Re: i want to change position of batch file window. how?

Posted: 11 Feb 2012 07:34
by Mohammad_Dos
it did not work for me :cry:

Re: i want to change position of batch file window. how?

Posted: 11 Feb 2012 08:05
by foxidrive
Mohammad_Dos wrote:it did not work for me :cry:


Try this. Maybe it is simpler to follow.

It creates file.bat that shows hello world.


Run the batchfile with "remove" as %1 to restore the registry setting to how it was.


Code: Select all

@echo off
set title=My Dos Window

if /i "%~1"=="remove" (
reg delete "hkcu\console\%title%"
goto :EOF
)

set xpos=150
set ypos=150
set /a "pos=(ypos << 16) + xpos"
>nul reg add "hkcu\console\%title%" /v WindowPosition /t REG_DWORD /d "%pos%" /f



 >file.bat echo.@echo off
>>file.bat echo.echo Hello World
>>file.bat echo pause

start "%title%" cmd /c "file.bat"

Re: i want to change position of batch file window. how?

Posted: 11 Feb 2012 10:05
by Mohammad_Dos
thank u. worked

is not exists any way to change position of the same batch file witch is already running?

Re: i want to change position of batch file window. how?

Posted: 11 Feb 2012 23:21
by foxidrive
If you explain why you need to do that then maybe there is a workaround.

For instance you can change the default properties of cmd or just the batch file you are running, to open at a particular location with a certain font size, colour etc etc.
Right click on the title bar to change those properties.

Re: i want to change position of batch file window. how?

Posted: 15 Feb 2012 17:12
by storm97
had a similar ?, can u make it full screen?

Re: i want to change position of batch file window. how?

Posted: 20 Feb 2012 08:27
by Mister Fox
storm97 wrote:had a similar ?, can u make it full screen?




On windows 7, the full-screen option for batch/cms windows is not present in the registry, and is therefore impossible to do.

On vista and below, pressing alt+enter will make the cmd window full screen.