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 Apr 16, 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

Script to Delete Files Older Than 7 Days

You can move files older than 7 days to another folder with a script or using command lines. Let us find out how to move the files instead of deletion.

Dany

Jun 04, 2024

Can't Delete Files or Format My SD Card When It's Not Locked

When you cannot delete files on an SD card, it means your SD card is locked or under protection. You can fix this problem by reading the passage below, and we will provide some methods.

Dany

Jun 20, 2024

How to Delete Hacker Files to Free Up Space on Windows

Virus attacks and malware may cause chaos on your computer, and you may not be able to delete some files. We will help you remove the files with CMD and show you how to format the hard drive.

Dany

Jun 20, 2024

Data Deleted by Mistake on Windows 7, What Can I Do

How can I restore files that have been permanently deleted? By hitting the Shift + Erase keys, you can delete files or directories from your computer. If you do this and need to retrieve permanently erased files, one of the various data recovery applications available is EaseUS Data Recovery Wizard.

Jaden

Apr 16, 2024

How to Create A Batch File to Delete Files Older Than N Days

You may save space and keep things ordered by removing files in any folder that are more than a certain number of days old. If you have a lot of files in several directories and wish to clean them up by removing those that are older than a certain number of days, you can use the ForFiles command.

Jaden

Jun 17, 2024

What Are Prefetch Files, and Is It Safe to Delete Prefetch Files

Is it safe to delete prefetch files on a Windows PC? This article will tell you the answer. And if you want to recover the permanently deleted files on your Windows PC, keep reading.

Brithny

Jun 20, 2024