I need to create a batch to move pdf files from a directory to a sub directory.
But those pdf files are open on a shared drive and cannot be moved.
So first I need them to be closed.
I am fully newbie in batch commands and I found the move command and my lines are working for all "not oppened" files but not for the openones.
So I found the Close command and the findstr command but something is wrong in my code can you help please ?
Code: Select all
findstr /I OS \\Server\CHAPEAU\OS\*.pdf
for /F %%a in (findstr /I OS \\Server\CHAPEAU\OS\*.pdf) do net files %%a /close
move /y "\\Server\CHAPEAU\OS\*.*" "\\Server\CHAPEAU\OS\Archive OS"
THANK'S A LOT !
Charles From PARIS FRANCE