Knightmare Posted July 15, 2018 Report Share Posted July 15, 2018 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 10.0.1.0. 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? Link to comment Share on other sites More sharing options...
shawn Posted July 17, 2018 Report Share Posted July 17, 2018 i've never used FixWin. are there subfolders below the versioned folders? such as "10.0.1.0\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! Link to comment Share on other sites More sharing options...
Knightmare Posted July 19, 2018 Author Report Share Posted July 19, 2018 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 Link to comment Share on other sites More sharing options...
shawn Posted July 24, 2018 Report Share Posted July 24, 2018 that's exactly how i would work around the problem 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