How to perform several file managing tasks?

lkjh

New Member
I suppose the following is best done using command line, so please instruct me on how.

1. How to merge folders inside same named folder?
I extracted some files and now they're like this:
folder1\folder1\files
folder2\folder2\files

I need to merge them to be:
folder1\files
folder2\files

I have many folders and it's completely impossible to do this by hand.

2. If the folder contains only a single file, how can I move it .. and append the folder name to the file after _ if it differs from the name of the file?
folder1\folder1.txt -> folder1.txt
folder2\filename.txt -> filename_folder2.txt

3. I extracted some zip archives and now the folders contain __MACOSX subfolders. I don't know what they're for, but they contain identical small files as the main files in the archive, so I suppose they're to help read them on os X. If they're not needed on Windows, I'd like to delete them. I tried doing this:
FOR /R "%cd%" %a IN (__MACOSX) DO rd %a /s
I put %cd% in quotes because otherwise the first question refers to the first word in the spaced path, but this still didn't change anything.
Also, it seems that if I copy the folders somewhere else, the __MACOSX disappear, though I didn't test this extensively.
 
Last edited:

My Computer

Back
Top