07 July 2014

Adjust Screen Resolution during Build

Sometimes the screen resolution in a build does not set to the maximum. Resolution can be set with PowerShell, but the scripting requirements and complexity is too much, IMO. AutoIT offers an easy way to automate this process. I have written this script to do just that. There is documentation within the script. You will need to have the AutoIT compiler for this. Here is the link to download it.


 #Region ;**** Directives created by AutoIt3Wrapper_GUI ****  
 #AutoIt3Wrapper_Outfile=install.exe  
 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****  
 ; Open Screen Resolution  
 Run( "control desk.cpl" )  
 Sleep( 2000 )  
 ; Tab to Resolution  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 ; Open Resolution Drop Down  
 Send( "{Enter}" )  
 Sleep( 250 )  
 ; Move Resolution Up to max. You may need to add more up arrows.  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 ; Accept resolution  
 Send( "{Enter}" )  
 Sleep( 250 )  
 ; Move to OK button  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 ; Apply New Resolution  
 Send( "{Enter}" )  
 Sleep( 5000 )  
 ; Accept New Resolution  
 Send( "k" )  
   

0 comments:

Post a Comment