Wolfshare Posted July 27, 2015 Share Posted July 27, 2015 Hello, i have a little problem with my script, i am using this kind of line, to check if the file is exist, and if it is on C:\Users\Tomas\Downloads folder then winrar them to C:\Users\Tomas\Downloads\Test\ if $FileToRun1 = "Get it.zip" ThenRun(@ProgramFilesDir & '\winrar\winrar.exe x "C:\Users\Tomas\Downloads\Get it.zip" "C:\Users\Tomas\Downloads\Test\"') But the problem that that file after downloading them comes with random strings like Get it__3687_i1566636907_il91240.exe.zip And i have no idea how to make script detect this file with random strings and then extract it.. Link to comment Share on other sites More sharing options...
jguinch Posted July 27, 2015 Share Posted July 27, 2015 In the helpfile, look at the _FileListToArray and FileFindFirstFile/FileFindNextFile functions Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 In the helpfile, look at the _FileListToArray and FileFindFirstFile/FileFindNextFile functionsPlease, help me with it... Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 27, 2015 Moderators Share Posted July 27, 2015 What do you need help with, and what did you try on your own already? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
guinness Posted July 27, 2015 Share Posted July 27, 2015 Erm...with 195+ posts one would expect you to know how to look in the help file. As for your problem, doesn't really make much sense to me. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 What do you need help with, and what did you try on your own already?Actually, i have no idae how to make it match the file.. Tried reading help files, trust me.. I am not Lazy, but i am simply do not understand this part.. Everything in my script works good, but not the part with finding file name, which has random generated numbers every time.. Link to comment Share on other sites More sharing options...
Danyfirex Posted July 27, 2015 Share Posted July 27, 2015 I think you want to detect a path with that feactures (random numbers some characters and special characters). Am I right? Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
MuffinMan Posted July 27, 2015 Share Posted July 27, 2015 Not a lot of info to go on, so I'm not sure if this would help you at all or not, but try replacing your IF statement with this...If StringLeft($FileToRun1,6) = "Get it" and StringRight($FileToRun1,4) = ".zip" Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 I think you want to detect a path with that feactures (random numbers some characters and special characters). Am I right? SaludosThat's right! Link to comment Share on other sites More sharing options...
Danyfirex Posted July 27, 2015 Share Posted July 27, 2015 Simple use file list to array.Local $aArray = _FileListToArray("C:\Users\Tomas\Downloads\") Local $sFileINeed = "" For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get it") And StringInStr($aArray[$i], ".exe.zip") Then $sFileINeed = $aArray[$i] ExitLoop EndIf NextSaludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 Simple use file list to array.Local $aArray = _FileListToArray("C:\Users\Tomas\Downloads\") Local $sFileINeed = "" For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get it") And StringInStr($aArray[$i], ".exe.zip") Then $sFileINeed = $aArray[$i] ExitLoop EndIf NextSaludosOke, but how to make them to extract that file to this folder?Downloads\TestUsed this line before.. But how to to do it right now? Run(@ProgramFilesDir & '\winrar\winrar.exe x "C:\Users\Tomas\Downloads\Get Downloader.zip" "C:\Users\Tomas\Downloads\Test\"') Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 Simple use file list to array.Local $aArray = _FileListToArray("C:\Users\Tomas\Downloads\") Local $sFileINeed = "" For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get it") And StringInStr($aArray[$i], ".exe.zip") Then $sFileINeed = $aArray[$i] ExitLoop EndIf NextSaludosOke, but how to make them to extract that file to this folder?Downloads\TestUsed this line before.. But how to to do it right now? Run(@ProgramFilesDir & '\winrar\winrar.exe x "C:\Users\Tomas\Downloads\Get Downloader.zip" "C:\Users\Tomas\Downloads\Test\"') Link to comment Share on other sites More sharing options...
Danyfirex Posted July 27, 2015 Share Posted July 27, 2015 append the paths. that I think. (I've never used winrar with commandline)Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 Tried Danyfirex solution, but still waiting for any help :(* Link to comment Share on other sites More sharing options...
Developers Jos Posted July 27, 2015 Developers Share Posted July 27, 2015 Seriously, what do you have after all the pointers given that isn't working?Jos 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. Link to comment Share on other sites More sharing options...
iamtheky Posted July 27, 2015 Share Posted July 27, 2015 (edited) If all you need is this:Run(@ProgramFilesDir & '\winrar\winrar.exe x ' & $sFileINeed & ' "C:\Users\Tomas\Downloads\Test\"')You have to change your title. Edited July 27, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 Part of my code.. Local $tempPID = Run(@ComSpec & ' /C dir /b | findstr /M /R /C:"^Get.*zip$"', "C:\Users\Tomas\Downloads\", @SW_HIDE, $STDOUT_CHILD)ProcessWaitClose($tempPID)$FileToRun1 = StdoutRead($tempPID)$FileToRun = '"' & 'C:\Users\Tomas\Downloads\' & $FileToRun1 & '"'$FileToRun = StringRegExpReplace($FileToRun, "\r\n", "")$FileToRun1 = StringReplace ($FileToRun1, @CRLF, "")Local $aArray = _FileListToArray("C:\Users\Tomas\Downloads\")Local $sFileINeed = ""For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get Downloader") And StringInStr($aArray[$i], ".exe.zip") Then $sFileINeed = $aArray[$i]Run(@ProgramFilesDir & '\winrar\winrar.exe x ' & $sFileINeed & ' "C:\Users\Tomas\Downloads\Test\"')Sleep(5000)Still does not work Link to comment Share on other sites More sharing options...
mikell Posted July 27, 2015 Share Posted July 27, 2015 (edited) The path, the path...For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get Downloader") And StringInStr($aArray[$i], ".exe.zip") Then $sFileINeed = $aArray[$i] ExitLoop EndIf Next $sFileINeed = "C:\Users\Tomas\Downloads\" & $sFileINeed Run(@ProgramFilesDir & '\winrar\winrar.exe x "' & $sFileINeed & '" "C:\Users\Tomas\Downloads\Test\"')EditOr useLocal $aArray = _FileListToArray("C:\Users\Tomas\Downloads\", "*.exe.zip", 1, 1) Local $sFileINeed = "" For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get Downloader") Then $sFileINeed = $aArray[$i] ExitLoop EndIf Next Run(@ProgramFilesDir & '\winrar\winrar.exe x "' & $sFileINeed & '" "C:\Users\Tomas\Downloads\Test\"') Edited July 27, 2015 by mikell Link to comment Share on other sites More sharing options...
Wolfshare Posted July 27, 2015 Author Share Posted July 27, 2015 The path, the path...For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get Downloader") And StringInStr($aArray[$i], ".exe.zip") Then $sFileINeed = $aArray[$i] ExitLoop EndIf Next $sFileINeed = "C:\Users\Tomas\Downloads\" & $sFileINeed Run(@ProgramFilesDir & '\winrar\winrar.exe x "' & $sFileINeed & '" "C:\Users\Tomas\Downloads\Test\"')EditOr useLocal $aArray = _FileListToArray("C:\Users\Tomas\Downloads\", "*.exe.zip", 1, 1) Local $sFileINeed = "" For $i = 1 To $aArray[0] If StringInStr($aArray[$i], "Get Downloader") Then $sFileINeed = $aArray[$i] ExitLoop EndIf Next Run(@ProgramFilesDir & '\winrar\winrar.exe x "' & $sFileINeed & '" "C:\Users\Tomas\Downloads\Test\"') Variable used without being declared.:For $i = 1 To $aArray[0]For $i = 1 To ^ ERROR Link to comment Share on other sites More sharing options...
jguinch Posted July 27, 2015 Share Posted July 27, 2015 Wolfshare, $aArray[0] is the array variable which contain the list of the files, so you have to put _FileListToArray before (like Mikell did in his last message) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management 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