Please help me to zip files with the same name in different directories along with the path after I enter search condition in the Windows Explorer - windows-7

I try to backup files by zipping the files along with path and store it in external hard drive.
When I zip the files I insist that I include the complete path of the file so that when I unzip the files , I can make the files get stored in the specified path if it all , my hard disc crashes.
When I try to search for files with the following criteria in Windows Explorer
(System.FileName: *.txt OR .doc OR .xls OR .rtf ) AND datemodified:‎10-‎03-‎2021 .. ‎06-‎07-‎2022
Whatever the results I get I right click click 7 zip and click add to (some zip file name).7z
Now when I do this I am getting the error duplicate file name on disc
Of course I will be having same file name in different directories.
Since , I am saving the path along with the file name this duplicate error should not have come.
Please help me to zip files with the same name in different directories along with the path after I enter the following search condition in the Windows Explorer
(System.FileName: *.txt OR .doc OR .xls OR .rtf ) AND datemodified:‎10-‎03-‎2021 .. ‎06-‎07-‎2022

Related

Move files to a folder if filename contains folder name

I am trying to move files of various extensions to a folder if the filename contains the folder name.
Simple example: I have several files such as Fox-1.doc, Fox-2.doc, etc. I have a folder named Fox. I'm trying to move the files into the folder Fox if folder name is contained in the filename.
I tried to modify the code in the following post but I was not successful.
Move files into existing folders containing part of the filename
Any pointers is appreciated.
If you are using code for doing this try getting the filename and filter from the .contains() method often found in Strings.
If you are using Linux command line I think this could work
mv *fox* destination_path/
For Powershell I found this thread that could help you:
powershell to move files based on part of file name
All you'd have to do is create the .ps1 with the modified script.

Batch re-name files in multiple directories on MacOS

I have around 500 JSON files sitting in their own directories that I need to re-name.
Every JSON file has the name, "list.json".
So what I need is a batch file operation for MacOS of some sort that will look in all the directories for files matching "list.json" and change the name to match name of the directory the file is sitting in. What kind of script do I need to do this?

How to rename a string in all file types?

How would I rename a string in all file types not just one file type like .txt in Windows 10? Like for example if all my file names were named Bear-(number) but there are lots of different file types like .html, .php, .pdf, .css, & more how could I rename them all? I don't want to have to list all the file types in the folder... Your help would be appreciated.
In windows 10, use command prompt by clicking on the windows button and typing in cmd
Switch to the directroy you have your files in - for example if they are in a directory called 'temp' enter cd temp.
Another example - if the files are in a nested folder like c:\temp\test - enter cd c:\temp\test
If they are on another drive, you will need to change to that drive by specifying the drive letter and then a colon... eg 'e:'
rename all files rename Bear-00001.* Bear-00002.*
The * at the end will preserve the file extension while changing the file name itself
hth

Double click on the zip file has to self-extract the file in the specified path

I have filename.zip file and if double click the file it has to extract the file in the desired location("c:\user\username"). I have tried using the batch file but didnt give me the required result.
#echo on
#set nested=%nested%Z
set _dest=c:\user\username
if NOT EXIST %_dest% md %_dest%
So if i double click on zip file it has to execute batch file to place file in the destination folder path.How can i do that?
If I understand correctly, you simply want to extract a .zip archive to a previously defined directory c:\user\username, when the user clicks that .zip archive.
No, this is not possible.
A .zip file has no default extraction destination. Nor has is a way to execute scripts upon extraction. It is just a container for compressed data. When you click it, your OS runs a program configured to handle .zip files, allowing you to view the contents, extract the contents, etc - but what and how exactly, is up to the user that clicked the file.
What you effectively want to have is an installer. Here are some pointers for options to do that:
Microsoft IExpress
Nullsoft Scriptable Install System (NSIS)
Quasi-installer using 7-zip self-extracting archive

How to find parent ZIP file from arguments when double-clicking in Windows Explorer - .NET 4.0

In Windows Explorer, when you open a ZIP file and double-click a file, say a JPEG file (.jpg), Windows extracts the JPEG file to a temporary folder, and passes the temporary file name to the associated program as the one and only argument, such as "C:\Users\jprice\AppData\Local\Temp\Temp1_<>.zip\<>.jpg"
I noticed that some applications, like the Windows Photo Viewer in Windows 7 know what ZIP file the temporary file came from. You can click next and previous and get the next/previous files from the ZIP file (as you do, they are also extracted to temporary files).
I've googled and prowled through system.io.packaging, but I can't figure out how to get the path of the original ZIP file (the file name is part of the temporary file path).
It's not done with the shell-->open command, Windows Photo Viewer only gets the temporary file name as far as I can tell.
The Photo Viewer command line is
%SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1
Which doesn't help. I did use ProcessMon to watch Photo Viewer and saw it read the .zip file (probably using zipfldr.dll) but could not discover how it knew where the original zip file was.
When I try it, I notice that WinZip initializes the spawned process's current working directory to the folder that the .zip resides in. If you can extract the .zip filename from the temp file path (and older OS versions did not do that), then you can reconstruct the original .zip file path.

Resources