Re: Automatic display resolution settings
- From: John John <audetweld@xxxxxxxxxxx>
- Date: Thu, 22 Mar 2007 15:33:30 -0300
To boot to a specific screen resolution "Automatically" based on day and time would require some sort of booting software that would read the day and time information from the BIOS and then decide which configuration to boot. Maybe easy for IBM and Microsoft to do but not an easy thing for average users like us! You could use "Windows Hardware Profiles" but that wouldn't be "Automatic", you would still have to check the time on a clock and choose the profile to boot accordingly.
An alternative is to have the resolution set to the desired settings by way of a batch file or logon script. The resolution will be changed when the script or batch file is processed. You cannot actually change the resolution itself with a script or batch file, the batch or script has to use a helper to do the actual changes. The screen resolution can only be changed by using the Display Properties GUI or by making a call on the SetResolution API. To change the resolution by way of batch file or script you will have to craft your own program or use a third party solution. The third party solution has to be "scriptable", or it has to be capable of running from the Command Prompt.
This is my solution:
ResChg.bat
=====================================================================
@echo off
echo. | date | FIND "(mm" > NUL
if errorlevel 1 (call :Parsedate DD MM) else (call :Parsedate MM DD)
::echo YYYY=%YYYY% MM=%MM% DD=%DD% Dow=%Dow%
goto :EOF
:Parsedate ----------------------------------------------------------
for /f "tokens=1-4 delims=/.- " %%A in ('date /t') do (set Dow=%%A& set %1=%%B& set %2=%%C& set YYYY=%%D)
for /f "tokens=1-2 delims=:." %%a in ('echo %time%') do (set tm=%%a%%b)
if /i %dow%==sun goto picaboo
if /i %dow%==sat goto picaboo
if /i %tm% LSS 915 goto picaboo
if /i %tm% GTR 1515 goto picaboo
reschangecon.exe -width=800 -height=600
goto :eof
:picaboo
reschangecon.exe -width=1024 -height=768
======================================================================
Watch for the word wrap. There are 18 lines in the file, including one blank line and the last line return, the "for /f" commands are each on one line only. Getting the %DOW% turned out to be a bit harder than I thought, the date format was a problem. I got the solution to that here: http://www.fpschultze.de/smartfaq+faq.faqid+60.htm
reschangecon.exe is available here: http://www.12noon.com/reschange.htm
Other similar utilities could also be used. To run the script on NT4 change ('echo %time%') to ('time /t') and set the Time Format in Regional Settings to: HH:mm:ss or H:mm:ss The file could be used in a logon script or you could place it, or a shortcut to it, in the appropriate Startup folder.
John
AppaBalwant wrote:
Dear experts,
I am not sure if this is the right group to ask this question.
I have an unusual requirement.
Whenever I start my machine between 9:30 AM to 3:15 PM on Monday through
Friday, I want the machine to boot up with 800x600 resolution.
At all other times, it should boot up with 1024x768 resolution.
A little bit of programming is OK with me.
I want this done badly!
Any takers?
Thanks in advance for your help.
If this is not the right group to ask this question, please guide me as to
where should I post this question.
Regards,
AppaBalwant
.
- Follow-Ups:
- Re: Automatic display resolution settings
- From: John John
- Re: Automatic display resolution settings
- References:
- Automatic display resolution settings
- From: AppaBalwant
- Automatic display resolution settings
- Prev by Date: Problem With Windows Update
- Next by Date: Re: Problem in moving an HD to another(better) computer
- Previous by thread: Re: Automatic display resolution settings
- Next by thread: Re: Automatic display resolution settings
- Index(es):
Relevant Pages
|