Jump to content
Ketarin forum

Remove previous folders

Recommended Posts

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:





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?

Share this post

Link to post
Share on other sites

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


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.