JimC Posted August 17, 2007 Share Posted August 17, 2007 I have a directory of which houses hotfixes in the following format. I would like to create a subdirectory which will house the hotfixes with everything stripped but kbxxxxxx.exe c:\hotfix\WindowsInstaller-KB893803-v2-x86.exe c:\hotfix\WindowsMedia-KB911564-x86-ENU.exe c:\hotfix\WindowsXP-KB873339-x86-ENU.exe c:\hotfix\WindowsXP-KB883667-x86-enu.exe would like c:\hotfix\stripped\ kb893803.exe kb911564.exe kb873339.exe kb883667.exe Link to comment Share on other sites More sharing options...
Zedna Posted August 17, 2007 Share Posted August 17, 2007 (edited) Look into Autoit helpfile at: FileFindFirstFile FileFindNextFile FileMove StringRegExp Edited August 17, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Paulie Posted August 17, 2007 Share Posted August 17, 2007 (edited) Try something like this, (Works if there are nothing but Hotfix .exes in the folder. Note: This is untested...Obviously. #Include <String.au3> $Path = "C:\Hotfix\" $Search = FileFindFirstFile($Path&"*.exe") If $search = -1 Then MsgBox(0, "Error", "No Hotfixes Found.") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $Numbers= _StringBetween($File,"-KB","-");may need to adjust this line $Test= FileMove($Path&$File,$Path&"\Stripped\KB"&$Numbers[0]&".exe",8) If Not $Test then MsgBox(0,"Error", "FileMove Error") WEnd MsgBox(0,"Complete","Hotfix Stripping Finished.") Edited August 17, 2007 by Paulie Link to comment Share on other sites More sharing options...
JimC Posted August 20, 2007 Author Share Posted August 20, 2007 any suggestions on the stringregExp function? I have tried the above , but am having much difficult getting it working so I have moved on trying to get this function to work. 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