#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include Global $aTaskbarinit = WinGetPos("[CLASS:Shell_TrayWnd]", "") $Window = GUICreate("Which of these programs do you need opened?:", 450, 250, @DesktopWidth, @DesktopHeight) WinSetOnTop("Which of these programs do you need opened?:", "", 1) Global $aWinInitGui = WinGetPos($Window) ;^^^^^^^^^^^^^^^^^^^^^^^^^^^GUI 1 Position^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $OMPlusAdmin = GUICtrlCreateCheckbox("OM Plus Admin", 8, 100, 89, 17) $EpicProd = GUICtrlCreateCheckbox("Epic Prod", 8, 120, 70, 17) ;41,17 $PuttyLWS = GUICtrlCreateCheckbox("Putty LWS", 8, 140, 70, 17) ;41, 17 GUICtrlCreateLabel("If either EPIC or Chronicles is open but not logged in just log into both at this time.", 8, 30) GUICtrlCreateLabel("CHECKMARK any that are not open then hit continue.", 8, 50) Global $OpenAppsButton = GUICtrlCreateButton("Continue", 8, 180, 75, 25, $WS_GROUP) ; Move the Initial GUI to the bottom right WinMove($Window, "", @DesktopWidth - $aWinInitGui[2] - 4, @DesktopHeight - $aWinInitGui[3] - $aTaskbarinit[3] - 4) GUISetState(@SW_SHOW) Sleep(2000) ;---------------------------------------------------------------------------------------------------------------------------- ;-------------------Is checked for each box $OMPlusChecked = GUICtrlRead($OMPlusAdmin) $EpicChecked = GUICtrlRead($EpicProd) $PuttyLWSChecked = GUICtrlRead($PuttyLWS) Global $CurrUser = StringMid("Currently logged in User: " & _GetConsoleUser(), 31, 6) ; Find out which ones were checked and pull out the name of the Printer. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $OpenAppsButton If GUICtrlRead($OMPlusAdmin) = $GUI_CHECKED Then GUICtrlSetData($OMPlusChecked, 'Checked') ShellExecute("C:\Users\" & $CurrUser & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Plus Technologies OM Plus DM\Control Panel.lnk") Sleep(2000) Else GUICtrlSetData($OMPlusChecked, 'Unchecked') EndIf If GUICtrlRead($EpicProd) = $GUI_CHECKED Then GUICtrlSetData($EpicChecked, 'Checked') ShellExecute("C:\Users\" & $CurrUser & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Epic\Hyperspace PROD.lnk") Sleep(2000) Else GUICtrlSetData($EpicChecked, 'Unchecked') EndIf If GUICtrlRead($PuttyLWS) = $GUI_Checked Then GUICtrlSetData($PuttyLWSChecked, 'Checked') ShellExecute("C:\Users\" & $CurrUser & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Epic\Putty_for_Epic.lnk") Send("{TAB 4} " & " {DOWN 12} " & " {ENTER}") WinWaitActive("You are connected to Epic PROD Environment - \\Remote") Send("2" & " {ENTER} ") Sleep(2000) Else GUICtrlSetData($PuttyLWSChecked, 'Unchecked') EndIf EndSwitch WEnd GUISetState(@SW_ENABLE) GUIDelete($Window) MsgBox(BitOR($MB_OK, $MB_SYSTEMMODAL, $MB_TOPMOST), "Hit OK when all are ready.", "Hit Ok once all 3 are logged into the main menu's and ready for input.") Func _GetConsoleUser($strComputer = ".") Local $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!//" & $strComputer) Local $colUsers, $objUser Local $strAccount $colUsers = $objWMIService.InstancesOf("Win32_ComputerSystem") For $objUser In $colUsers $strAccount = $objUser.UserName Next If $strAccount <> "" Then Return $strAccount Else Return SetError(1, 0, 0) EndIf EndFunc ;==>_GetConsoleUser