;===================================== ; joe phillips func Usage() dim $t $t = "" $t = $t & "Command Line Usage For Batch Files: " & @crlf & @crlf & "Alert buttons icon wait= [Title in Brackets] All other text to be displayed" & @crlf & @crlf $t = $t & "buttons (optional default = Okay ) can be yesno or okcancel" & @crlf $t = $t & "icon ( option default = none ) can be warning, information, stop, or question" & @CRLF $t = $t & "wait ( ignores buttons and icons if present ) wait=3 means wait 3 seconds" & @crlf $t = $t & "[Title] Make Sure brackets touch the first and last words"& @crlf $t = $t & "All other words on the line will be the message"& @crlf $t = $t & @crlf & "Returns ErrorLEvel=0 for OKay or Yes."& @crlf $t = $t & "Returns ErrorLEvel=1 for No or Cancel." msgbox(64,"Alert Usage", $t) EndFunc if $CmdLine[0] = 0 then Usage() Exit endif if stringinstr($cmdline[1],"?",0) > 0 or stringinstr($cmdline[1],"help",0) > 0 then Usage() Exit endif $c = stringlower($CmdLine[1]) $a = 0 $c = "" $t = "" $intitle = 0 $wait = "" for $i = 1 to $cmdLine[0] $w = $cmdLine[$i] if stringlower(stringleft($w,4))="wait" Then $wait = stringmid($w,6) ContinueLoop endif $a1 = $a if stringlower($w) = "yesno" then $a = $a + 4 if stringlower($w) = "okcancel" then $a = $a + 1 if stringlower($w) = "warning" then $a = $a + 48 if stringlower($w) = "information" then $a = $a + 64 if stringlower($w) = "stop" then $a = $a + 16 if stringlower($w) = "question" then $a = $a + 32 if $a1 = $a Then if stringleft($w,1) = "[" then $inTitle = 1 $w = stringmid($w,2) EndIf if $inTitle=1 Then if StringRight($w,1) = "]" then $inTitle = 0 $w = StringLeft($w,stringlen($w)-1) EndIf $t = $t & " " & $w Else $c = $c & " " & $w EndIf EndIf Next $c = stringmid($c,2) $t = stringmid($t,2) #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.5 Prototype #include #endregion --- GuiBuilder generated code End --- if $wait <> "" Then ; ignore all but message ($c) GuiCreate($t, 350, 80,(@DesktopWidth-350)/2, (@DesktopHeight-80)/2 , $DS_MODALFRAME + $WS_VISIBLE) $Label_1 = GuiCtrlCreateLabel($c, 20, 15, 300, 20) GUICtrlSetFont($label_1,12,800) GUICtrlsetcolor($label_1,0x0000ff) GuiSetState() sleep($wait*1000) Exit Else $i = msgbox($a,$t,$c) if $i = 1 or $i = 6 then exit(0) exit(1) endif