Aapjuh Posted July 3, 2012 Posted July 3, 2012 Hi all, Case: I'm trying to have my script download an file from a URL, but the URL/File keeps changing. Question: How can i script in something like/as a wildcard for an URL? Example: The URL is something like this "www.meow.com/meow/awesomefile-273-884-58.exe" 273-884-58 is the part that keeps changing to random numbers , File and .exe is what is always thesame Tried: InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\" & "*.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\" & "?.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\File" & "*.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\File" & "?.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\File*" & ".exe", 1, 1) well u get my drift. Thnx in advance, Aapjuh
Aapjuh Posted July 3, 2012 Author Posted July 3, 2012 weird no permission to edit my own post ^^ Ment: InetGet("www.meow.com/meow/awesomefile-" & "*.exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile-" & "?.exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile*" & ".exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile?" & ".exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1) InetGet("www.meow.com/meow/awesomefile*.exe", "C:UsersUserDesktop*" & "Awesomefile.exe", 1, 1)
GEOSoft Posted July 3, 2012 Posted July 3, 2012 (edited) Local $s_Url = "www.meow.com/meow/awesomefile-2F3DB458.exe" Local $s_File = StringRegExpReplace($s_Url, ".+/(.+)", "$1") InetGet($s_Url, "C:UsersUserDesktop" & $s_File, 1, 1) Edit: You don't have enough total posts yet to be able to edit your posts. IIRC the magic number is 5. Edited July 3, 2012 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
DicatoroftheUSA Posted July 3, 2012 Posted July 3, 2012 (edited) _INetGetSource and stringregexp then followup with inetgetPlease don't make malware. Edited July 3, 2012 by DicatoroftheUSA Statism is violence, Taxation is theft. Autoit Wiki
Aapjuh Posted July 3, 2012 Author Posted July 3, 2012 Thnx for the reply's i'll try it 2morrow since im at a diffrent pc atm and the rest of my script aint on this one @Dictatorofzeusa nah not making malware, im making a script to automaticaly install latest ccleaner when no ccleaner is installed, keep a log, run once every sunday and automatically do settings and clean, and dl+place latest ccenhancer ini file.
DicatoroftheUSA Posted July 3, 2012 Posted July 3, 2012 (edited) It's just the way you described it, usually "Hyperbolic name+random-characters-to-defeat-filebased-scans+.exe"=bad news. eg. #include <INet.au3> $sSite="http://www.piriform.com/ccleaner/download/standard" $sSource=_INetGetSource ($sSite) $aDownload=StringRegExp($sSource,"http://.*ccsetup.*?.exe",3) MsgBox(0,"Download Link",$aDownload[0]) Edited July 3, 2012 by DicatoroftheUSA Statism is violence, Taxation is theft. Autoit Wiki
GEOSoft Posted July 4, 2012 Posted July 4, 2012 You should never need that _INetGetSource() function any more. Not since InetRead() has been working correctly and that's a few years now. $s_Str = BinaryToString(InetRead($sSite)) I see no sense including libraries when you don't need most of the functionality and particularily when there are functions native to AutoIt that will handle the job. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
DicatoroftheUSA Posted July 4, 2012 Posted July 4, 2012 Thanks geo, I don't use it often, didn't even notice. Statism is violence, Taxation is theft. Autoit Wiki
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