Jump to content
LaunchBox Community Forums

7z Batch File Help Needed | SOLVED


Recommended Posts

I have a batch file that will go through current directory and compress all files into 7z format. Works great. But it will not go through Sub Directories. Can anyone help me get it to go through Sub Directories and output the 7z files into their proper sub directories as needed?

The Batch:
 

@ECHO OFF
FOR %%i IN (*.*) DO (
ECHO "%%i" | FIND /I "zip.bat" 1>NUL) || (
"Y:\7Zip\7-Zip\7z.exe" a -t7z -mx9 "%%~ni.7z" "%%i"
)
)

--UPDATE--
A friend of mine figured it out.

Use this to quickly zip up your rom library while maintaining existing folder structure. Then simply open your database xml in something like Notepad++, do a Find All for w/e file extension you were using before (example .iso) and Replace All with .7z. Good for quickly compressing thousands of ROMs that you have already downloaded and imported into LaunchBox.

 

for /r %%F in (*) do "Y:\7Zip\7-Zip\7z.exe" a -t7z -mx9 "%%~dpnF" "%%F"

 

Edited by kdub87
  • Like 1
Link to comment
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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...