Hi
Since Kodi is updated i cant get my library to work properly, its a filename that is wrong.
Example:
Folder: Kids movies
Sub-folder: Aladdin
Files in sub-folder: Aladdin.mkv, poster.jpg, Aladdin-fanart.jpg and Aladdin.nfo
Now the problem is that the poster.jpg must be named Aladdin-poster.jpg for everything to work.
Its about 400 sub-folders with the same structure so it should be best to use the folder-name or the nfo filename to fix this.
I am new to this, but i have read some batch coding and edited som batch files but not more than that.
Thank you for reading this.
Best Regards Richard Sabelström
Rename files in subfolders based on folder or other file?
Moderator: DosItHelp
-
- Posts: 18
- Joined: 08 Oct 2016 07:42
-
- Posts: 18
- Joined: 08 Oct 2016 07:42
Re: Rename files in subfolders based on folder or other file?
Used Bulk Rename Utility.
Didnt work on network so had to move the library arund but now its working
Didnt work on network so had to move the library arund but now its working
Re: Rename files in subfolders based on folder or other file?
Code: Select all
:scan
set location=c:\.
rem enter location
set name=test
rem enter name
dir /b %location% > location.txt
set exist=0
for /f %%Y in ( location.txt ) do (
if %%Y==%name% set exist=1
)
del location.txt
if %exist%==1 cd %location%
if %exist%==1 rename %name% %newname%
rem done
just edit it yourself. havent tested it.
but it should change the name of the file
have not entered the names in the script
you can slo do a full scan of all directories but i would not advice it.
or with a starting folder then do
dir /b /s %foldername%
Last edited by Squashman on 13 Jan 2017 14:09, edited 1 time in total.
Reason: MOD EDIT: Please use code tags.
Reason: MOD EDIT: Please use code tags.