supadodger Posted March 29, 2009 Share Posted March 29, 2009 trying to create an array out of all executables in a sub-directory and then execute them all 1 at a time with a runwait. just send me in the right direction or any help anyone can offer is appreciated. Link to comment Share on other sites More sharing options...
LiveOnTheFly Posted March 29, 2009 Share Posted March 29, 2009 trying to create an array out of all executables in a sub-directory and then execute them all 1 at a time with a runwait.just send me in the right direction or any help anyone can offer is appreciated.Try looking up FileFindFirstFile and FileFindNextFile in the help file. Link to comment Share on other sites More sharing options...
supadodger Posted March 29, 2009 Author Share Posted March 29, 2009 Try looking up FileFindFirstFile and FileFindNextFile in the help file.the problem i have is really making arrays.anytime i try i end up doingWhile $z < 20$z = 1 + 1if $z = 1 thenrunwait blah.exeEndifand so on down the list. Link to comment Share on other sites More sharing options...
rajeshontheweb Posted March 29, 2009 Share Posted March 29, 2009 just what i had been working on a while ago. will post the code this afternoon, just need to dig it thats all :-) ps: use FileFindFirstFile() & FileFindNextFile() will post detailed codelater.. Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
LiveOnTheFly Posted March 29, 2009 Share Posted March 29, 2009 here this example code puts every exe file in the subdirectory "subdirectory" into an array #include <array.au3> Dim $aFiles[101];I dont thnik you'll be needing mroe than 100 exes'? $aFiles[0] = 0 $hFileSearch = FileFindFirstFile("subdirectory\*.exe") while 1 $sFileToAdd = FileFindNextFile($hFileSearch) If @error = 1 Then ExitLoop EndIf $aFiles[0]+=1 $aFiles[$aFiles[0]] = $sFileToAdd WEnd _ArrayDisplay($aFiles) Link to comment Share on other sites More sharing options...
Valuater Posted March 29, 2009 Share Posted March 29, 2009 Maybe... #Include <File.au3> Global $Location = @DesktopDir $FileList=_FileListToArray($Location, "*.exe", 1) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf For $x = 1 To UBound($FileList) -1 $Runner = FileGetShortName($Location & "\" & $FileList[$x]) ; Testing ConsoleWrite($Runner & @CRLF) Sleep(1000) ; Do it!! ;RunWait($Runner) Next **********8 TESTED OK Valuater 8) Link to comment Share on other sites More sharing options...
TerarinK Posted March 29, 2009 Share Posted March 29, 2009 You know that could be used for a bug, sorry to say. I would take them but for sure have another one with which youve already tested and know if they are good, because many hacks might be on anyones system. Also I wouldn't create a array and at the same time Runwait with it, what would be the sense of creating the array then? Runwait or better yet just Run would work with a little catch to it depending of the systems speed only run a few exe at any one time, most important of the is it should be outside the creating the array, maybe like Valuater did and one step further would be create a temporary file for it. Why you ask, because this thing wouldn't be about speed but ensuring the exe are run. 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
Valuater Posted March 29, 2009 Share Posted March 29, 2009 I remember doing something very similar to this for running cleaners. I wanted to run spyware, then adware, then internet cleaner, then.... and lastly the defrager I did it something like this... #Include <File.au3> Global $Location = @DesktopDir $FileList=_FileListToArray($Location, "*.exe", 1) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf $Argument = StringSplit(" -w, /n, etc..", ",") For $x = 1 To UBound($FileList) -1 $Runner = FileGetShortName($Location & "\" & $FileList[$x]) ; Testing ConsoleWrite($Runner & @CRLF) Sleep(1000) ; Do it!! ;RunWait($Runner & $Argument) Next (just an example so you can get the idea) 8) 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