Hello again,Here is another quick script I wrote that might be of some use to some people. This sets the screen resolution fields in unattend.txt based on the actions in a user-selectable menu. You can set your own predefined menu options, or choose each field manually.
One important thing to note is that it does not do any input validation, so entering random text is possible. It won't screw anything up, and Windows will just use its default screen mode when it can't make sense of the information.
The code is probably fairly self-explanatory. But if anyone wants to extend it or make changes and post them back, that would be great. :)
Good luck!
# File to hold site-specific customizations. # Enable maximum warnings and disallow sloppy constructs. use warnings; use strict; # Screen Resolution menu my @ScreenRes; sub ask_screen_res() { my $ret = ''; while (scalar @ScreenRes < 4) { $ret = menu_choice ( '1680 x 1050, 32-bit @ 60hz (19"+ 16:9 LCD)' => '1680x1050x32x60', '1280 x 1024, 32-bit @ 75hz (17"+ 4:3 CRT/LCD)' => '1280x1024x32x75', '1024 x 768, 24-bit @ 60hz (15" 4:3 CRT)' => '1024x768x24x60', 'Other' => undef ); $ret or $ret = simple_q('Horizontal resolution (e.g. 1024): ') . 'x' . simple_q('Vertical resolution (e.g. 768): ') . 'x' . simple_q('Bits per pixel (e.g. 24): ') . 'x' . simple_q('Refresh rate (e.g. 60): '); @ScreenRes = split /x/, $ret; print 'Selected Screen Resolution: ' . $ScreenRes[0] . ' x ' . $ScreenRes[1] . ', ' . $ScreenRes[2] . '-bit @ ' . $ScreenRes[3] . "hz\n"; } return @ScreenRes; } $u->{'Display'}->{'Xresolution'} = sub { my @ret = ask_screen_res(); return $ret[0]; }; $u->{'Display'}->{'Yresolution'} = sub { my @ret = ask_screen_res(); return $ret[1]; }; $u->{'Display'}->{'BitsPerPel'} = sub { my @ret = ask_screen_res(); return $ret[2]; }; $u->{'Display'}->{'VRefresh'} = sub { my @ret = ask_screen_res(); return $ret[3]; }; # Make this file evaluate to "true". 1;
begin:vcard fn:Jason Oster n:Oster;Jason org:Camp Navajo;Information Technology adr:Bldg 1;;1 Hughes Ave;Bellemont;AZ;86015;USA email;internet:jason.os...@campnavajo.com title:IT Specialist III tel;work:928-773-3363 x-mozilla-html:FALSE url:http://www.campnavajo.com/ version:2.1 end:vcard
------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________ unattended-info mailing list unattended-info@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unattended-info