UtahTechDad Posted May 30, 2008 Share Posted May 30, 2008 Re: InputBox function... Am I "up in the night", or should not the value in the "Default" field be passed if the timeout threshold is reached? Specifically, the following line returns a NULL if nothing is entered in fifteen seconds, but I would have thought that it should return the value. It shows properly and is passed if you hit enter, but I am looking for an unattended script with default values. Note: I have a work-around, but it is ugly and I am just performing a self-sanity-check. Thanks! $sTID1 = InputBox("Transaction Manager Installation - step 1/3", "What is your destination server IP?", "10.231.201.160","",355,120,Default,Default,15) Link to comment Share on other sites More sharing options...
spudw2k Posted May 30, 2008 Share Posted May 30, 2008 (edited) The timeout function basically performs a cancel on the InputBox. You can verify this by checking @error. See below. I would say make the default value a variable and assign it if the return is "" and @Error = 2 Success: Returns the string that was entered. Failure: Returns "" (blank string) and sets @error as follows: @Error 0 = The string returned is valid. 1 = The Cancel button was pushed. 2 = The Timeout time was reached. 3 = The InputBox failed to open. This is usually caused by bad arguments. $defaultip = "10.231.201.160" $sTID1 = InputBox("Transaction Manager Installation - step 1/3", "What is your destination server IP?", $defaultip,"",355,120,Default,Default,15) If $sTID1 = "" and @error = 2 Then SetError(0) $sTID1 = $defaultip EndIf Edited May 30, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
someone Posted May 30, 2008 Share Posted May 30, 2008 (edited) I know you said you have a workaround, but as you are looking for "an unattended script with default values", you could simply do this; $Def_IP = "10.231.201.160" $sTID1 = InputBox("Transaction Manager Installation - step 1/3", "What is your destination server IP?", $Def_IP,"",355,120,Default,Default,15) If $sTID1 = "" Then $sTID1 = $Def_IP MsgBox(0, "$sTID1", $sTID1) The better way to approach this (if this is unacceptable) is to use a GUI. EDIT Doh got beat... Edited May 30, 2008 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
spudw2k Posted May 30, 2008 Share Posted May 30, 2008 EDIT Doh got beat...Happen's to us all. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now