folder mover
Moderator: DosItHelp
folder mover
hi,
I have 100's of folder with 1 file in each folder.
the folder name consists of 13 digits.
I need a script to move/copy only these folders with the content from source to destination.
any help
thanx in advance
I have 100's of folder with 1 file in each folder.
the folder name consists of 13 digits.
I need a script to move/copy only these folders with the content from source to destination.
any help
thanx in advance
Re: folder mover
A little more detail would help. Provide source and destination examples is normally very helpful.
Re: folder mover
the source E:\logfiles
the destination f:\fordeletion
the destination f:\fordeletion
Re: folder mover
1) Which of either MOVE or COPY?move/copy only these folders
2) Folders where the name consists of 13 digits AND that contain only 1 file? Or only the first or only the latter? What exactly is the condition to select the folder?
Steffen
Re: folder mover
I am not a Dentist but I play one on the forums.
I think only people in the USA will get that joke as it is used in a lot of commercials over the years.
Re: folder mover
the condition is move
to move all folders which contain 13 digit name to destination (all the folder contain a single file inside)
to move all folders which contain 13 digit name to destination (all the folder contain a single file inside)
Re: folder mover
This should work if the destination folder already exists
Steffen
PS @Squashman You could've left a Youtube link for extraterrestrials like me
Code: Select all
@echo off &setlocal
set "source=E:\logfiles"
set "destination=f:\fordeletion"
for /f "delims=" %%i in ('dir /ad /b "%source%"^|findstr /x "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"') do (
move "%source%\%%~i" "%destination%\"
)
PS @Squashman You could've left a Youtube link for extraterrestrials like me
Re: folder mover
ha ha ha
thanx steffen will update the results after running the script
that's so kind of you to have spent your time on this ..
joe
thanx steffen will update the results after running the script
that's so kind of you to have spent your time on this ..
joe
Re: folder mover
Squashy -
I prefer the Holiday Inn one myself... LOL
I prefer the Holiday Inn one myself... LOL
Re: folder mover
yes this worked perfectly too
Thank you steffen
Thank you steffen