Script which copies original files from shortcut paths - windows

I have a folder that has subfolders with some files that are shortcuts to their original file in a different location outside these main folder. I need to write a script (Windows preferably) that parses through each subfolder and goes to each folder from the shortcuts target path and copies the original file into a specific folder.
In the end I want a folder with a copy of all the original files that were shortcuts from my subfolders.
Is this possible? Thank you so much!

Related

How to move a file into a subdirectory with bash?

so I'm having trouble with moving my file into a subdirectory. Right now I have a jpg file in my Downloads folder that I want to move over to my images folder, which is contained inside my Desktop and odin-links-and-images folders. Just for a bit of clarification, my Downloads folder is a completely separate directory, and I want to move the jpg file inside my Downloads folder to
Desktop/odin-links-and-images/images
What I've tried so far is doing the following command inside my Downloads directory:
mv dog.jpg images/
Doing this, I ended up getting the error:
mv: cannot move 'dog.jpg' to 'images/': Not a directory
I assume this is because my dog.jpg file is in my Downloads folder, which is a completely separate directory from my Desktop/odin-links-and-images/images directory. I'm not sure if it's possible to move my jpg file, but I'd appreciate any guidance on how to do this!
Write the complete path to images:
mv dog.jpg ~/Desktop/odin-links-and-images/images
This is assuming Desktop is in home. Otherwise, use whatever is the full path to desktop.

How to move all files within subfolders into a new folder using bash?

I have a folder that I downloaded all my fonts to. When I opened the folder i noticed they were saved out into subfolders.
Is there a bash-shell script to grab all the files within the subfolders and move them to the parent folder?
You can move files with same extensions recursively using the wildcards. e.g. if you want to move all log files in nested folders under log/ directory into backup/ directory, you can use the following command:
mv log/**/*.log backup/

Windows Batch copy folder with subfolders but not the files in the folder itself?

I have a folder e.g. called Apples.
Inside that folder are folders starting from ATA, ATB, ATC and going to ATX.
Inside ATA folder (and all other AT* folders) I have an Excel file and folders from 01 to 12.
I want to copy all of the folders 01-12 but not the Excel file directly in ATA (just its subfolders and all their contents) and paste them in every other AT* folder.
Is there a way to do it? I don't mind manually having to type every AT* folder name.

Move files from multiple folders to multiple folders in Linux

How can I move files from multiple folders to another location. For example if I have 3 folders with name /test/folder1, /test/folder2, /test/folder3 and I want to move the contents of these folders into another location like /temp/folder1, /temp/folder2 /temp/folder3 using a script. I do not want to move these folders, instead I want to move the files inside these folders. Please Help
Something like
cd test
for dir in folder*; do
mv "$dir/*" "/temp/$dir"
done

ApplScript to compress folder?

What is the AppleScript to compress a folder? Not let the user select a folder from the dialog but give the folder path on a string variable. The script I know compresses the folder with the full path as folder. For example: if the folder names "ABC" is in this folder location, "Applications:Data:Level" then the compressed folder will create the folder structure like this "Applications:Data:Level:ABC" and put the content. I do not want this one. The compress ApplScript must not maintain this folder structure.
?
If you use zip, cd to the parent directory of the zipped directory first:
do shell script "cd /usr/share; zip /tmp/dict.zip -r dict"
There are no AppleScript commands for creating archives, and Archive Utility is not scriptable.

Resources