clorophilla Posted August 31, 2018 Report Share Posted August 31, 2018 I'm using https://buildbot.orphis.net/ to update my PCSX2 install through Ketarin. I set it to extract its files (from a .7z archive) to a folder on my computer, but since it's a new version i need to remove the previous folder(s) of the same name. In the folder i see this: -pcsx2-v1.5.0-dev-2525-g846f31851-windows-x86 -pcsx2-v1.5.0-dev-2533-gb374b1bca-windows-x86 -pcsx2-v1.5.0-dev-2534-gada5daf7c-windows-x86 Obviously, version 2534 is the most recent, but i can't find how to detect and remove the old versions. Can someone help me with some script to do this on Ketarin? Link to comment Share on other sites More sharing options...
shawn Posted August 31, 2018 Report Share Posted August 31, 2018 Are you saving the file with the original file name? Yo could save them with just the version (since they're all win32 you don't need "-hash-windows-x86"). Saving with just the version number would allow you to skip this issue. If you'd rather do it post-extract then you can use powershell with something like this: Get-ChildItem $Path | Where{$_.Name -Match "<RegEx Pattern>"} | Remove-Item This would look something like this in practice: Get-ChildItem "k:\_ketarin\builds\pcsx2" | Where{$_.Name -Match "pcsx2-v[\d\.]+-dev-\d+-[a-z0-9]+-windows-x86"} | Remove-Item You could also use something much simpler if you want to trim it down a bit: Get-ChildItem "k:\_ketarin\builds\pcsx2" | Where{$_.Name -Like "pcsx2-v*"} | Remove-Item Or if you want to delete all of them but exclude the current build you could use: Get-ChildItem "k:\_ketarin\builds\pcsx2" | Where{$_.Name -Like "pcsx2-v*"} | Where{$_.Name -NotLike "pcsx2-v{version}*"} | Remove-Item 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