07 July 2014

Adjust Screen Resolution during Build

Posted By: Mick Pletcher - 10:50 AM

Share

& Comment

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" )  
   

About Mick Pletcher

My blog is here to help solve issues I have encountered and solved, publish scripts I have written, and educate others in understanding areas that are not well covered

0 comments:

Post a Comment

Copyright © 2013 Mick's IT Blogs™ is a registered trademark.