jammzhentai450 0 Posted October 9, 2011 I am making an information viewer that tells the user about their system. The OS part bugs me as it says, $OS is not linked to the CaseSwitch. expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ScrollBarConstants.au3> #include <array.au3> #include <GuiStatusBar.au3> #include <GuiEdit.au3> #include <GuiButton.au3> #include <Misc.au3> #include <String.au3> #Include <File.au3> Opt("TrayIconHide", 1) GUICreate("Computer Settings", 600, 250, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS)) GUISetBkColor(0xFFFFFF) $Username2 = GUICtrlCreateLabel(@UserName, 10,15,180,35) GUICtrlSetFont(-1, 20, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x000000) $Username1 = GUICtrlCreateLabel("Username:", 10,5,90,15) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x000000) $desk2 = GUICtrlCreateLabel(@DesktopWidth & "x" & @DesktopHeight, 10,65,180,35) GUICtrlSetFont(-1, 20, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x000000) $desk1 = GUICtrlCreateLabel("Resolution:", 10,55,90,15) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x000000) $OSVerify = GUICtrlCreateLabel( "Windows " & $OS , 10, 115, 180, 35) GUICtrlSetFont(-1, 20, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x000000) $os1 = GUICtrlCreateLabel("Windows Version:", 10,105,90,15) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x000000) $ButtonExit = GUICtrlCreateButton ("Close" 550, 170, 40, 20) GUICtrlSetOnEvent($ButtonExit,"_Close") GUISetState(@SW_SHOW) While 1 Sleep ( 20 ) WEnd Func _Close ( ) Sleep ( 10 ) Exit EndFunc Switch @OSVersion Case "WIN_2008R2" $OS = "Server 2008 R2" Case "WIN_7" $OS = "Seven" Case "WIN_2008" $OS = "Server 2008" Case "WIN_VISTA" $OS = "Vista" Case "WIN_2003" $OS = "Server 2003" Case "WIN_XP" $OS = "XP" Case "WIN_XPe" $OS = "XP Embedded" Case Else $OS = "Unknown/Too Old!" EndSwitch Can anyone help? Share this post Link to post Share on other sites
JFX 10 Posted October 9, 2011 You use $OS before you assign it! Put your Switch .. EndSwitch section before GUI creation. Also read remarks GUICtrlSetOnEvent , if you use it. Share this post Link to post Share on other sites
jammzhentai450 0 Posted October 9, 2011 oh! thanks for the help Share this post Link to post Share on other sites
water 2,391 Posted October 9, 2011 Before you re-invent the wheel. There is already a available. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites