Jump to content
Ketarin forum

rd command wildcard support

Recommended Posts

I'm trying to figure out how to delete a subfolder that is created when I download FixWin 10. I have the program set to extract the zip folder into a FixWin folder that I have created using the 7z e command to ignore the original structure; however, if a new version is released, the folder named after the version, so I'm left with an empty folder in my FixWin folder with the version name. Currently, it is If a new version comes out, then the name of that folder will change and when I update, I believe that I will have two empty folders: one with the old version name and the other with the new version name. I would like to delete the empty folder during extraction but I don't know how to do that. Any help?



Share this post

Link to post
Share on other sites

i've never used FixWin. are there subfolders below the versioned folders? such as "\something\file.ext"? if not, then you can just extract the entire contents of the zip file into the FixWin folder, overwriting with new data. your first post-download command should be doing that already:

7z e "{file}" -o"{root}SyMenu\ProgramFiles\FixWin" -y 

that said, you could always use a for loop to do it instead:

for /f "delims=" %%d in ('dir "{root}SyMenu\ProgramFiles\FixWin" /s /b /ad ^| sort /r') do rd "%%d"

or robocopy:

ROBOCOPY "{root}SyMenu\ProgramFiles\FixWin" "{root}SyMenu\ProgramFiles\FixWin" /S /MOVE

good luck!

Share this post

Link to post
Share on other sites

There are not any subfolders; however, when the zip file contains the files in a folder. When I do 7z e, it takes out the contents of the folder and puts them in the FixWin folder that I have along with the folder that it emptied:


When I unzip it with the commands that I show in my first post, I get this:


Since I don't need the Internet shortcut or the Text Document, my work around is this:

7z e "{file}" -o"{root}SyMenu\ProgramFiles\FixWin\" *.exe *.dll -r -y

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.