Re: Automatic display resolution settings



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



.



Relevant Pages

  • Re: login window resolution
    ... the parts about changing the boot up resolution which you are interested in. ... up manager] has an optional, not always there, configuration file at ... the video resolution for the default kernel to be booted. ...
    (Ubuntu)
  • Re: [SLE] booting to different monitors
    ... I booted into a blank screen after the first grub menu. ... This allowed the computer to display the boot process, ... > started in kde it went blank, as kde apparently does not check the resolution ...
    (SuSE)
  • Re: How to clean up mess after ATI Catalyst Control Center and Gnome Screen resolution tool?
    ... after setting up the resolution using ATI ... Boot using the recovery mode; select the xfix option, ... normal boot. ... and restart gdm as above. ...
    (Ubuntu)
  • Re: Help!
    ... script that makes a web site automatically adjust to different ... If you remember having heard something about a script for this purpose, ... was probably a script which detects the monitor resolution and redirects the ... user to a page supposedly designed for that resolution. ...
    (microsoft.public.frontpage.programming)
  • Re: suse 8.2 and my lcd monitor q
    ... >> I use LCD monitors too, and there were similar problems initially. ... >> selectable option on the boot screen at 8.2. ... I seem to remember that you could hit a function key to select a resolution, ... kernel, etc). ...
    (alt.os.linux.suse)