Replacing a files into multiple folders/subdirectories - windows

Is there a way in command prompt to take files and replace it into another folder and it's sub directories based on it's name?
I have an images in my folder and i have folder have sub directories that have the same name of images, what i want to do i need to replace the image in the sub directories base on the image in my main folder.

I searched for other similar questions and I found a few topics that might interest you.
Batch file to move files based on name w/o creating new folders
Batch Create a Folder Based on Filename, and Move Multiple Related
Files to The Created Folder
If you post the code you have already tried, it may be possible to fix any issues you are having.

Related

Create new file in EnvDTE.SolutionFolder without specifying full path

The EnvDTE80.SolutionFolder interface (https://learn.microsoft.com/en-us/dotnet/api/envdte80.solutionfolder) has an AddFromFile() method, but requires the absolute full path of an existing file. Unfortunately the solution folder object itself doesn't contain a property with the path of the folder on disk.
Is there an easy way to create a new (text) file in a SolutionFolder without needing to know it's full absolute path? We just want a new file which is a direct child of the folder.
Something like this:
EnvDTE80.SolutionFolder folder;
var file = folder.CreateFile("myFile.txt");
But not:
EnvDTE80.SolutionFolder folder;
var file = folder.AddFromFile("c:\path_to_folder\myFile.txt");
Unfortunately the solution folder object itself doesn't contain a property with the path of the folder on disk.
Exactly. It's because the solution folders are virtual, they are not related to any physical folders in the file system. You can have "MyFolder" solution folder in your solution and no "MyFolder" in you file system.
You CAN have also the physical folder just for the convenience:
C:\Solution
MyFolder
myFile.txt
But even then, this physical folder is absolutely unrelated to the solution folder. The solution folder may contain files from anywhere, even from outside the solution root physical folder. That's why you must supply the full path if you want to add a file to a solution folder.
If you know that you have the structure of solution folders mirrored also in physical folder structure, you can construct the full path manually. Get the directory name of the solution with EnvDTE80.Solution.FullName, combine it with the EnvDTE80.SolutionFolder.Parent.Name and then with the file name.

I'm looking to have a Folder recognise new files being saved into it and then copy new files into a collated folder

In MacOS i want a folder action to trigger when i place a new file into a subfolder. The action should grab a newly added file to the folder and copy it to another folder where all the latest files are collated and can be viewed together. I also want the script to delete any old version of the same file it copies across to the collated folder. The trouble is the file names are slightly dfferent as they have a version number in them. The version number is defined as "v01a" to start with but can change to "v01b" or "v01e" or "v02a" or "v03c".
So if a file called "1234_ProjectName_Image01_COMP_v01a.jpg" already exists and a new file called "1234_ProjectName_Image01_COMP_v01b.jpg" is added the the file called "1234_ProjectName_Image01_COMP_v01a.jpg" needs to be deleted from the destination folder.
I've tried a few times to get started in automator but never really get the pieces in place for it to be useful.
(SOURCE)
Dailies/_Internal
Dailies/_Internal/Image01/1234_ProjectName_Image01_COMP_v01a.jpg
Dailies/_Internal/Image02/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Internal/Image03/1234_ProjectName_Image03_COMP_v01a.jpg
(DESTINATION)
Dailies/_Latest
Dailies/_Latest/1234_ProjectName_Image01_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image03_COMP_v01a.jpg
If a new file is added called
Dailies/_Internal/Image01/1234_ProjectName_Image01_COMP_v02a.jpg
then this file is copied from its source folder and put into the Destination folder.
(DESTINATION)
Dailies/_Latest
Dailies/_Latest/1234_ProjectName_Image01_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image01_COMP_v02a.jpg
Dailies/_Latest/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image03_COMP_v01a.jpg
Here there is already an image with the same name except the version number so the script should also delete the old file leaving me with.
(DESTINATION)
Dailies/_Latest
Dailies/_Latest/1234_ProjectName_Image01_COMP_v02a.jpg
Dailies/_Latest/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image03_COMP_v01a.jpg
I can't for the life of me figure out how to do this, any ideas would be greatly appreciated.
Screengrab of my very basic automator here

Changing file names based on their filetype extension

So am kind of new to using command lines in Terminal and stuff. However, I was interested if someone could help me with this thing. I would prefer if somebody with Terminal knowledge can help, but Command Prompt is good as well.
I have a folder with name say Videos and inside this folder I have multiple files: one mp4, one ppt, one pdf, and one doc. The video name is say "Movieking1-1" and all other file types have name as "sample".
Now what I would like is a set of commands which searches for all the extensions like *.pdf and *.docs in the folder and give it the name of that as the one for the .mp4 and add -yt So if my folder was like this:
Movieking1-1.mp4
sample.docx
sample.pdf
The command should work and change the name for the file in that folder as
Movieking1-1.mp4
Movieking1-1-transcript.docx
Movieking1-1-transcript.pdf
There are no other docs or pdfs either in the same folder.
I am asking help because i have to do this for more than 100 folders.
Any help is appreciated
Thanks in advances

Create folder in selected folder with OS X Automator

I am trying to batch convert a bunch of raw image files on OS X. I would like to use built-in software since it is possible.
First I would like to
let the user select the input folder containing the raw files;
create a new folder jpgs inside of that folder;
copy the raw files from the user selected folder into jpgs.
This is the workflow I have implemented so far in order to implement the first two steps.
First I let the user select a folder and store it into the variable NEF Folder. The I create a new folder named jpgs in the folder chosen by the user (NEF Folder).
BUT this is what the workflow does after selecting folder AAA on the Desktop:
Why?
Understood.
The action New folder creates a folder and copies its input inside of the newly created folder.
I have the same issue and solved it checking the box "Ignore this action's input".

How to move multiple files when moving only one file

If you've ever saved a a full webpage you'll notice that it creates the .htm file and a folder that contains all the icons and scripts for the page.
If you move the .htm file to a new location, the folder that came with it moves to the same location, and the behavior is the same if you move the folder, the .htm file will move with it.
How can I do that with any old file/folder combination? Can this be manipulated?
EDIT: Programmatically (through CMD)
Is there a command that binds files to other files etc.?
This is a feature of the shell called Connected Files. It is specifically implemented for web pages; it is not generic or extensible as far as I know.
It doesn't even seem that useful to me as it only works when using the shell mechanisms (SHFileOperation and friends); if plain old CopyFile/MoveFile are used then all the files need to be handled individually.

Resources