Jump to content

Recommended Posts

Posted

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

Posted (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 by Paulie
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...