How to Delete Files from Archive by Text File

I attempted to use the for / i loop to get 7zip to refer to the list, but it kept trying to open the text file as an archive. I'm looking for a technique to automate the deletion of the JndiLookup.class file from all log4j files that contain that class. Because they are not in a fixed location, I planned to dump the sites into a text file using PowerShell or wmi. What can I do?

Best Answered by

Jaden· Answered on Mar 25, 2024

The process is comparable to renaming a file inside a zip archive. You'll need to unzip everything, create a new file or replace the existing one with the extracted data. Therefore, proceed as before but omit the problematic file.

Given the large number of log4j files scattered around the system, you can point 7zip to a relative path. It will remove the files inside the archive, which are .jar files, close them without extracting them, and zip them back up. Because, as known, the files are dispersed, there is no way, at least that we have discovered, to have 7zip recursively execute it. We thought we could have it refer to the text file that gives the locations of all the files, but it didn't work.

Although 7zip allows using a text file, such as @somelistfile.txt, it only appears to work for creating archives, not deleting files from archives.

However, suppose you insist on renaming or deleting the file without opening a temporary directory of the zip files from the archive. In that case, you may pay attention to corrupting the files on your computer.

If the invalid ZIP files or folders are no longer accessible on your computer, try to fix them to work correctly. If you simply cannot open or utilize the ZIP file or folder because it displays an error message indicating that the compressed or zipped folder or file is invalid, as seen below, proceed to restore corrupted invalid Zip files immediately.

And relax if you can't find the ZIP file on your computer or external hard drive. It was most likely removed from Downloads or was not saved in the standard location on your devices.

The simplest solution to locate your missing or invisible ZIP files or folders is to launch a dependable EaseUS Data Recovery Wizard and quickly restore them. With only three simple steps, EaseUS Data Recovery Wizard can restore all lost files such as.zip files or other data.

Use EaseUS Data Recovery Wizard to recover deleted or lost files easily and quickly.

Tutorials on how to recover lost, deleted, or formatted data from HDD, SSD, USB, SD card, or other storage media on Windows and Mac.

People Also Ask

How to Delete Photoshop Temp Files on Windows 10

If your hard drive gets full because of Photoshop temp files, you must learn about this page. You can know the Photoshop temp files' location and whether it is safe to delete Photoshop temp files on Windows 10. Then, you can delete Photoshop temp files with ease.

Dany

Apr 07, 2024

Email Recovery Software Recovers Deleted Emails [2024]

Couldn't find solutions to recover deleted emails in Outlook? Don't worry! We will recommend the best solution for you to recover deleted emails in Outlook. Keep reading and you will find the answer in this passage.

Dany

Mar 25, 2024

How to Recover Deleted Books from Kindle [2024 Guideline]

Have you accidentally deleted the book from your Kindle account? Download the free and robust Kindle recovery tool when you find no other way to restore deleted texts, images, pictures, or videos from Kindle Fire HD or Kindle Paperwhite.

Jaden

Mar 21, 2024

How to Recover Deleted Items with Windows File Recovery

Some files you cannot recover from the Recycle Bin can be recovered with third-party data recovery software or Windows File Recovery. Keep reading to learn the details.

Dany

Apr 15, 2024

Can't Delete PDF Files from A Shared Folder, What Can I Do

Shift + Delete can be used to delete PDF files or directories permanently. If you still can't remove PDF files on a Windows server, read how to force delete a PDF file that won't be deleted on your Windows PC.

Jaden

Mar 22, 2024

How to Recover Deleted Files on Windows File Server

You can recover deleted files on Windows Serve due to system updates, thoughtless deletion, formatting, or an unexpected virus assault using EaseUS data recovery software. Continue reading to recover Windows Server files right away.

Jaden

Apr 16, 2024