Ejoc Posted April 6, 2005 Posted April 6, 2005 I posted a version of this in a couple of threads, this opens a url using your default web browser: #include-once #include <file.au3> Func BrowseURL($URL) Local $fd $fd = FileOpen(@TEMPDir & "url.url",2) if $fd = -1 Then return -1 FileWriteLine($fd,"[InternetShortcut]") FileWriteLine($fd,"URL=" & $URL) FileClose($fd) Run(@comspec & " /c " & chr(34) & @TEMPDir & "url.url" & chr(34)) return 0 EndFunc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
SlimShady Posted April 6, 2005 Posted April 6, 2005 1. You are not as noob as I thought. 2. I just made two smaller versions BrowseURL_1('http://www.autoitscript.com') Sleep(5000) BrowseURL_2('http://www.autoitscript.com') Func BrowseURL_1($URL) Local $TempFile $TempFile = @TempDir & "\Website.url" INIWrite($TempFile, "InternetShortcut", "URL", $URL) Run(@comspec & ' /c "' & $TempFile & '"', @SystemDir, @SW_HIDE) EndFunc Func BrowseURL_2($URL) Run(@comspec & ' /c START "" "' & $URL & '"', @SystemDir, @SW_HIDE) EndFunc
zcoacoaz Posted April 6, 2005 Posted April 6, 2005 (edited) i don't know whats better but i usually just do this Run ( @ComSpec & " /c start http://www.autoitscript.com" ) edit: this version doesn't show a black command box Run ( @ComSpec & " /c start http://www.autoitscript.com", @SystemDir, @SW_HIDE ) Edited April 6, 2005 by Xenogis [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
Ejoc Posted April 6, 2005 Author Posted April 6, 2005 (edited) 1. You are not as noob as I thought. I'm still a noob, I've only been using AutoIt for like a month 2. I just made two smaller versionsBrowseURL_1('http://www.autoitscript.com') Sleep(5000) BrowseURL_2('http://www.autoitscript.com') Func BrowseURL_1($URL) Local $TempFile $TempFile = @TempDir & "\Website.url" INIWrite($TempFile, "InternetShortcut", "URL", $URL) Run(@comspec & ' /c "' & $TempFile & '"', @SystemDir, @SW_HIDE) EndFunc Func BrowseURL_2($URL) Run(@comspec & ' /c START "" "' & $URL & '"', @SystemDir, @SW_HIDE) EndFunc<{POST_SNAPBACK}>I like the use of INIWrite.I was trying to remember how to do a URL on the command line, I forgot the STARTI like the BrowseURL_2 method Edited April 6, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
sykes Posted April 6, 2005 Posted April 6, 2005 And for those of you using Autoit w/COM: _OpenWeb("http://www.autoitscript.com") Func _OpenWeb($URL) $oWeb = ObjCreate("Shell.Application") $oWeb.Open($URL) EndFunc Tested with IE6 and Firefox 1.02 We have enough youth. How about a fountain of SMART?
zcoacoaz Posted April 6, 2005 Posted April 6, 2005 I just tested the com and it works with Avant too and that browser is pretty unstable [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
silvanr Posted April 8, 2005 Posted April 8, 2005 And for those of you using Autoit w/COM:What is Autoit w/COM? Sorry, which my English is so bad. I come from Switzerland ;-)
w0uter Posted April 8, 2005 Posted April 8, 2005 (edited) this one (latest version if im correct) has com support. look it up in the help file http://www.autoitscript.com/forum/index.php?showtopic=10256get it here: http://www.autoitscript.com/fileman/users/jpm/AutoIt3-gui/ Edited April 8, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
vicsmurf Posted April 10, 2005 Posted April 10, 2005 this one (latest version if im correct) has com support. look it up in the help file http://www.autoitscript.com/forum/index.php?showtopic=10256get it here: http://www.autoitscript.com/fileman/users/jpm/AutoIt3-gui/<{POST_SNAPBACK}>When will there be a version released where you can compile the COM options because i love them Maybe the next version or does a compliler exists?
w0uter Posted April 10, 2005 Posted April 10, 2005 When will there be a version released where you can compile the COM options because i love them Maybe the next version or does a compliler exists?<{POST_SNAPBACK}>just copy the .bin from the .zip to the aut2exe folder My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
vicsmurf Posted April 10, 2005 Posted April 10, 2005 just copy the .bin from the .zip to the aut2exe folder<{POST_SNAPBACK}>Man i'am feeling stupid! Thnx man!
piccaso Posted April 10, 2005 Posted April 10, 2005 I like it this way... _ShellExec("http://www.autoitscript.com") Func _ShellExec($sCmd, $sVerb = "open", $sArg = "", $sFolder = @ScriptDir, $parent_hwnd = 0, $state = @SW_SHOWNORMAL) Local $aRet $aRet = DllCall("shell32.dll", "long", "ShellExecute", "hwnd", $parent_hwnd, "string", $sVerb, _ "string", $sCmd, "string", $sArg, "string", $sFolder, "long", $state) Return $aRet If $aRet[0] > 32 Then Return 1 Else Return 0;Problems EndIf EndFunc CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
silvanr Posted April 12, 2005 Posted April 12, 2005 (edited) _BrowseURL("www.autoitscript.com") Func _BrowseURL($url="") $x = RegRead("HKEY_CLASSES_ROOT\http\shell\open\command", "") Run($x & " " & $url) EndFunc (tested only with: Windows 2k German) Edited April 12, 2005 by silvanr Sorry, which my English is so bad. I come from Switzerland ;-)
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