Hi Eustace
This toggle script makes use of an external program QRes.exe (freeware) to
do the actual screen resolution changing. It needs to be placed in the
same folder as the script, or alternatively, somewhere in your 'path' eg
c:\windows.
You can currently download QRes.exe from here
http://www.snapfiles.com/get/qres.html
Change lines 2 & 3 of the script accordingly, to put in the resolutions,
of your choosing - in the same format as the ones shown eg "800 x 600". I
haven't tested it with the particular resolutions you suggested.
NB Be very careful which particular resolutions you choose, ie ones that
your monitor / graphics card can definitely handle - otherwise you'll end
up doing a safe mode system restore [or putting a link to a modified
script in your startup folder to get things back to normal (as I did just
now when experimenting

)]
Again watch out for wordwrap. Let me know if it works ok.
Jon
'***************************************************************
'Toggles resolutions between the following settings
res1= "800 x 600"
res2= "1024 x 768"
'Initialization
set WshShell = WScript.CreateObject("WScript.Shell")
'Process the resolutions
res1=trim(lcase(res1))
res2=trim(lcase(res2))
xres1=trim(left(res1,instrrev(res1,"x")-1))
yres1=trim(mid(res1,instrrev(res1,"x")+1))
xres2=trim(left(res2,instrrev(res2,"x")-1))
yres2=trim(mid(res2,instrrev(res2,"x")+1))
'Get current resolution
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_DisplayConfiguration")
For Each objItem in colItems
currentXRes = trim(objItem.PelsWidth)
currentYRes = trim(objItem.PelsHeight)
Next
'Decide which resolution to set
if (currentXRes = xres1) and (currentYRes = yres1) then
xres = xres2 : yres = yres2
else
xres = xres1 : yres = yres1
end if
'Run the command to set the resolution
runstring = "cmd /c " & chr(34) & "qres.exe /x:" & xres & " /y:" & yres &
chr(34)
wshshell.run runstring,0
'**********************************************************************
Eustace said:
Thanks, but it is not exactly what I need... First of all it does not
have the 1280x800 resolution that I normally use (while it contains
640x480 that is not available), so I would have to restore it through the
normal procedure. Also, its 800x600 resolution shows things much larger
then when I apply it the normal way. Besides, though it saves a couple of
clicks, a shortcut to toggle between the 2 specific resolutions would
simplify things a lot...