DigDeep Posted February 27, 2014 Share Posted February 27, 2014 Hi, I am new to this forum. I am preparing a code and would need urgent help please. Basically the code should1. scan the complete directory (C:) to look for a specific folder / file name (TESTER).2. save the results with the location paths in a text file.3. Delete all the files and folders in those locations. I have prepared the code but unfortunately it doesn't work. #Include <Array.au3>#include <Constants.au3>#include <IE.au3>#include <ClipBoard.au3>#include <File.au3> ;~ Scan for TESTER existance$sST = Run(@ComSpec & " /c " & "dir tester*.* /s", "C:", @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD)Local $ResponseTextWhile 1 $ResponseText &= StdoutRead($sST) If @error Then ExitLoopWendIf $ResponseText = True ThenMsgBox(16, "Warning", "Unknow Program activity found on your PC. Click OK to clean.")RunWait(@ComSpec & " /c " & "del tester*.* /s", "C:", @SW_HIDE)EndIf Link to comment Share on other sites More sharing options...
BrewManNH Posted February 27, 2014 Share Posted February 27, 2014 FileListToArrayRec, _FileWriteFromArray, FileDelete, those should get you started. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
DigDeep Posted February 27, 2014 Author Share Posted February 27, 2014 (edited) I tried with _FileListToArray but it is not working.The thing I need is..I do not know how many locations / paths the folder or file is saved with the name "Tester".So, I want 1st to display all the directory and files with the complete path and then delete all of them.eg: if the file is saved in all these locations how can I search both Files and folders by giving the wildcard tester*.*?c:UsersusernameAppDataLocalMicrosoftInternet ExplorerDOMStoreDUQD8HGVen.tester[1].xmlc:UsersusernameAppDataLocalMicrosoftInternet ExplorerDOMStoreKSB5GQC5vlc-media-player.en.tester[1].xmlc:UsersusernameAppDataLocalMicrosoftWindowsTemporary Internet FilesContent.IE54ZVZAXYLen_tester_com[1].htmc:UsersusernameAppDataLocalMicrosoftWindowsTemporary Internet FilesContent.IE54ZVZAXYLlogo_tester_follow_download[1].pngc:UsersusernameAppDataLocalMicrosoftWindowsTemporary Internet FilesContent.IE57HTA1AT0vlc-media-player_en_tester_com[1].htmc:UsersusernameAppDataLocalMicrosoftWindowsTemporary Internet FilesContent.IE5B43J6AHU30603;728568;201;pixel;tester;testerTargetedTxtLogoSmartAds[1].htmc:UsersusernameAppDataLocalMicrosoftWindowsTemporary Internet FilesContent.IE5B43J6AHU30603;730675;201;redirect;tester;testerTargetedTxtLogoSmartAdsAnalyzeThat[1].htmc:UsersusernameAppDataLocalTechSmithSnagitDataStoreWebSiteIconsvlc-media-player.en.tester.com.icoc:UsersusernameDownloadsProgramstester.exeC:UsersusernameAppDataRoamingIDMDwnlDatausernametesterCan you please write the code? Edited February 27, 2014 by sunshinesmile84 Link to comment Share on other sites More sharing options...
BrewManNH Posted February 27, 2014 Share Posted February 27, 2014 I tried with _FileListToArray but it is not working.I said _FileListToArrayRec, actually I forgot the initial underscore but it still would have been found in the help file without it.Can you please write the code?No. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
DigDeep Posted February 27, 2014 Author Share Posted February 27, 2014 There is no result for _FileListToArrayRec. I have checked in the helpfile too but it does not exist. Link to comment Share on other sites More sharing options...
BrewManNH Posted February 27, 2014 Share Posted February 27, 2014 Yes it does, you have the wrong version of AutoIt, update and you will find it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
DigDeep Posted February 27, 2014 Author Share Posted February 27, 2014 I am having latest SCITE version# 3.3.7 installedAutoIT Version is 3.3.11.3but _FileListToArrayRec is still not present in the help. Link to comment Share on other sites More sharing options...
DigDeep Posted February 27, 2014 Author Share Posted February 27, 2014 I got the answer.Thanks 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