Rem The file movement could fail in case of a PDF file with new Move "%FilePDF%" "XYZ FOLDER\OCC-%numeroa:~0,5%#%nature%.pdf" Rem Move the PDF file to XYZ FOLDER and rename the file while moving it. Rem The text version of the PDF file is no longer needed. Rem Restore initial command environment and exit batch file processing.įor /F "delims=- tokens=2" %%J in ('%SystemRoot%\System32\find.exe "Number=" "%FileTXT%"') do set "numeroa=%%J"įor /F "delims= tokens=2" %%J in ('%SystemRoot%\System32\find.exe "NAME=" "%FileTXT%"') do set "nature=%%J" Set "DSUBDIX=%USERPROFILE%\Google Drive\CLASSEURS"įor /F "delims=" %%I in ('dir *.pdf /A-D /B 2^>nul') do call :RenamePDF "%%~fI" Rem Don't know what this environment variable is for. Setlocal EnableExtensions DisableDelayedExpansion Perhaps this commented batch file code works for moving all PDF files in current directory to subdirectory XYZ FOLDER with new file name determined from contents of each PDF file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |