First of all, I am a total beginner. I was trying an ultimate script bat file solution for a game. To not annoy you with details, let me tell you what I tried to do.
Example:
- I have 17 files. 10 of them are .jpg and 7 of them are .obj files.
- The images are in path
\mods\images
and the objects are in path\mods\models
. - I want to list all 17 missing files in a
list.txt
- The bat file will read that list, search for the files and paste them into the
TTSmissing
folder
and here are my problems:
- The bat script only looks exactly into the source path, but not into subfolders (that's why I wrote
\mods\images\
, to test if it works) so what I basically want is:\Tabletop Simulator\Mods\
as source path and the script shall look into all subfolders, too. - The
list.txt
only works, when the filenames also have their extensions. is it possible to change the script so i don't need the extension? so it will only look for names and copy the files? (example: the names in the list have to be like:hello123.jpg
. It's not working when its onlyhello123
.) - How do I need to change the bat script if i don't want a list.txt but just put the list of files right into the bat file?
@echo off
mkdir %USERPROFILE%\Desktop\TTSmissing
set src_folder=%USERPROFILE%\Documents\My Games\Tabletop Simulator\Mods\Images
set dst_folder=%USERPROFILE%\Desktop\TTSmissing
set file_list=%USERPROFILE%\Desktop\list.txt
for /f "tokens=*" %%i in (%file_list%) DO (
xcopy /S/E "%src_folder%\%%i" "%dst_folder%"
)
pause