Thomas V
2006-11-28 08:34:34 UTC
Hi.
When I press CTRL+ALT in vmware and later go back to my VMware
maschine, the resolution is not restored to "full screen" but some
strange resolution. (I have set Fit Visible, Fit Guest...)
I found vbs script to change it automaticly: (it simulates keypress :)
http://justaweebitcloser.com/index.php/site/extended/how_to_change_resolution_in_windows_automatically/
I made some modifications so here it is:
(Mybe you will have to modify sleep times or keypresses :)
'resHigh.vbs - Set screen resolution to 1024x768
'
'Author: Geoffrey Climer
'Version 1.0 - November 1st 2006
'Version 1.1 - 28.11.2006 Thomas V (Check if the resolution is allready
' 1024x768 and opens Display Properties on Settings
page.)
'--------------------------------
toWidth = 1024
toHeight = 768
'--------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &_
strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from
Win32_DisplayConfiguration",,48)
'I have only one display :)
For Each objItem in colItems
DisplayHeight = objItem.PelsHeight
DisplayWidth = objItem.PelsWidth
Next
If (DisplayHeight <> toHeight) Or (DisplayWidth <> toWidth) Then
'Set WshShell Variable and WshNetwork Variable
Set WshShell = WScript.CreateObject("WScript.Shell")
'Run Control Panel to open Display Properties
WshShell.Run("%windir%\system32\control.exe desk.cpl @0,4")
'Set focus on Display Properties window and wait 200 milliseconds
WScript.Sleep 200
WshShell.AppActivate ("Display Properties")
WScript.Sleep 100
'Send keystrokes to move resolution slider all the way to the left
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
'Send keystrokes to move resolution slider twice to the
right(1024x768)
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
'Go through the popup dialogues saying "OK" to each
WshShell.SendKeys"{ENTER}"
'WScript.Sleep 10
'WshShell.SendKeys"{ENTER}"
WScript.Sleep 100
WshShell.SendKeys"{TAB}"
WScript.Sleep 10
WshShell.SendKeys"{ENTER}"
End If
'End Script
WScript.Quit
'ResolutionLow.vbs - Set screen resolution back to 800x600
'
'Author: Geoffrey Climer
'Version 1.0 - November 1st 2006
'Version 1.1 - 28.11.2006 Thomas V (Check if the resolution is allready
' 800x600 and opens Display Properties on Settings
page.)
'--------------------------------
toWidth = 800
toHeight = 600
'--------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\"_
& strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from
Win32_DisplayConfiguration",,48)
'I have only one display :)
For Each objItem in colItems
DisplayHeight = objItem.PelsHeight
DisplayWidth = objItem.PelsWidth
Next
If (DisplayHeight <> toHeight) Or (DisplayWidth <> toWidth) Then
'Set WshShell Variable and WshNetwork Variable
Set WshShell = WScript.CreateObject("WScript.Shell")
'Run Control Panel to open Display Properties
WshShell.Run("%windir%\system32\control.exe desk.cpl @0,4")
'Set focus on Display Properties window and wait 200 milliseconds
WScript.Sleep 200
WshShell.AppActivate ("Display Properties")
WScript.Sleep 100
'Send keystrokes to change to the settings tab
WshShell.SendKeys"+{TAB}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
'Send keystrokes to move down to set screen resolution
WshShell.SendKeys"{TAB}"
WScript.Sleep 10
'Send keystrokes to move resolution slider all the way to the left
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
'Send keystrokes to move resolution slider once to the right (800x600)
'Go through the popup dialogues saying "OK" to each
WshShell.SendKeys"{ENTER}"
WScript.Sleep 10
'WshShell.SendKeys"{ENTER}"
'WScript.Sleep 100
WshShell.SendKeys"{TAB}"
WScript.Sleep 10
WshShell.SendKeys"{ENTER}"
End If
'End Script
WScript.Quit
Best regards,
Thomas.
When I press CTRL+ALT in vmware and later go back to my VMware
maschine, the resolution is not restored to "full screen" but some
strange resolution. (I have set Fit Visible, Fit Guest...)
I found vbs script to change it automaticly: (it simulates keypress :)
http://justaweebitcloser.com/index.php/site/extended/how_to_change_resolution_in_windows_automatically/
I made some modifications so here it is:
(Mybe you will have to modify sleep times or keypresses :)
'resHigh.vbs - Set screen resolution to 1024x768
'
'Author: Geoffrey Climer
'Version 1.0 - November 1st 2006
'Version 1.1 - 28.11.2006 Thomas V (Check if the resolution is allready
' 1024x768 and opens Display Properties on Settings
page.)
'--------------------------------
toWidth = 1024
toHeight = 768
'--------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &_
strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from
Win32_DisplayConfiguration",,48)
'I have only one display :)
For Each objItem in colItems
DisplayHeight = objItem.PelsHeight
DisplayWidth = objItem.PelsWidth
Next
If (DisplayHeight <> toHeight) Or (DisplayWidth <> toWidth) Then
'Set WshShell Variable and WshNetwork Variable
Set WshShell = WScript.CreateObject("WScript.Shell")
'Run Control Panel to open Display Properties
WshShell.Run("%windir%\system32\control.exe desk.cpl @0,4")
'Set focus on Display Properties window and wait 200 milliseconds
WScript.Sleep 200
WshShell.AppActivate ("Display Properties")
WScript.Sleep 100
'Send keystrokes to move resolution slider all the way to the left
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
'Send keystrokes to move resolution slider twice to the
right(1024x768)
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
'Go through the popup dialogues saying "OK" to each
WshShell.SendKeys"{ENTER}"
'WScript.Sleep 10
'WshShell.SendKeys"{ENTER}"
WScript.Sleep 100
WshShell.SendKeys"{TAB}"
WScript.Sleep 10
WshShell.SendKeys"{ENTER}"
End If
'End Script
WScript.Quit
'ResolutionLow.vbs - Set screen resolution back to 800x600
'
'Author: Geoffrey Climer
'Version 1.0 - November 1st 2006
'Version 1.1 - 28.11.2006 Thomas V (Check if the resolution is allready
' 800x600 and opens Display Properties on Settings
page.)
'--------------------------------
toWidth = 800
toHeight = 600
'--------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\"_
& strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from
Win32_DisplayConfiguration",,48)
'I have only one display :)
For Each objItem in colItems
DisplayHeight = objItem.PelsHeight
DisplayWidth = objItem.PelsWidth
Next
If (DisplayHeight <> toHeight) Or (DisplayWidth <> toWidth) Then
'Set WshShell Variable and WshNetwork Variable
Set WshShell = WScript.CreateObject("WScript.Shell")
'Run Control Panel to open Display Properties
WshShell.Run("%windir%\system32\control.exe desk.cpl @0,4")
'Set focus on Display Properties window and wait 200 milliseconds
WScript.Sleep 200
WshShell.AppActivate ("Display Properties")
WScript.Sleep 100
'Send keystrokes to change to the settings tab
WshShell.SendKeys"+{TAB}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
WshShell.SendKeys"{RIGHT}"
WScript.Sleep 10
'Send keystrokes to move down to set screen resolution
WshShell.SendKeys"{TAB}"
WScript.Sleep 10
'Send keystrokes to move resolution slider all the way to the left
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
WshShell.SendKeys"{LEFT}"
WScript.Sleep 10
'Send keystrokes to move resolution slider once to the right (800x600)
'Go through the popup dialogues saying "OK" to each
WshShell.SendKeys"{ENTER}"
WScript.Sleep 10
'WshShell.SendKeys"{ENTER}"
'WScript.Sleep 100
WshShell.SendKeys"{TAB}"
WScript.Sleep 10
WshShell.SendKeys"{ENTER}"
End If
'End Script
WScript.Quit
Best regards,
Thomas.