copyleft Posted April 27, 2004 Posted April 27, 2004 when specify "comspec" in a script to open a browser window. how do you hide the brief DOS window that appears before the browser opens? Is there anyway to minimize the DOS window or hide it altogether?[ e.g., this won't do it: RunWait(@ComSpec & ' /c 'http://hiddensoft.com',' ',@SW_HIDE) winsetstate("HiddenSoft","",@SW_RESTORE) Any suggestions?
Developers Jos Posted April 27, 2004 Developers Posted April 27, 2004 think it will always show the cmd screen briefly... you could start your browser directy to avoid the "DOS" box... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
scriptkitty Posted April 27, 2004 Posted April 27, 2004 if you want it to start hidden, you might try accessing the browser directly: Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE http://hiddensoft.com','',@sw_hide) sleep(1000) winsetstate("HiddenSoft","",@SW_RESTORE) but yes, if using comspec, you get the blink. AutoIt3, the MACGYVER Pocket Knife for computers.
jterwelp Posted April 27, 2004 Posted April 27, 2004 but yes, if using comspec, you get the blink.On what speed computer and OS? I've never seen a cmd blink with @SW_HIDE.Jeff
copyleft Posted April 28, 2004 Author Posted April 28, 2004 98se Dual Xeons (of course only one cpu being used with this OS :-). Unfortunately, I can't call a specific browser, cause user may be running firefox, which is my preference :-). Curiously, though, the hide function seems to work on some scripts but not on others. Weird...
Valik Posted April 28, 2004 Posted April 28, 2004 You can easily get the default browser from the registry. In fact, I've written a function that does that. ; =================================================================== ; RunBrowser($szUrl) ; ; Looks up the web browser and launches it with the specified URL (Can be a file, too) ; Parameters: ; $szUrl - IN - The URL (or file) to launch the browser with. ; Returns: ; Sets @error to 1 on failure (Browser can't be found) ; =================================================================== Func RunBrowser($szUrl) Local $szBrowser = RegRead("HKEY_CLASSES_ROOT\HTTP\shell\open\command", "") If StringLeft($szBrowser, 1) = '"' Then $szBrowser = StringTrimLeft($szBrowser, 1) Local $nChar = StringInStr($szBrowser, '"') If $nChar Then $szBrowser = StringTrimRight($szBrowser, StringLen($szBrowser) - $nChar + 1) EndIf If StringLen($szBrowser) = 0 Then Return SetError(1) Run($szBrowser & " " & $szUrl) EndFunc; RunBrowser() Example: RunBrowser("http://www.hiddensoft.com") This should open the default browser to the Hiddensoft homepage.
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