Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MOVE "C:UsersabcdeDesktopPractice_Folderbatch renamelocation1*.txt" "C:UsersabcdeDesktopPractice_Folderbatch renamelocation2"
- RENAME "C:UsersabcdeDesktopPractice_Folderbatch renamelocation2*-*" ???_????.txt
- CD "C:UsersabcdeDesktopPractice_Folderbatch_renamelocation1"
- for /R %%f in (*-*.txt) do call :copyFile %%f
- goto: eof
- :copyFile
- xcopy %1 "C:UsersabcdeDesktopPractice_Folderbatch_renamelocation2"
- set file=%~nx1
- rename file %str:-=_%
- @ECHO ON
- SET Loc1Dir=C:UsersabcdeDesktopPractice_Folderbatch_renamelocation1
- SET Loc2Dir=C:UsersabcdeDesktopPractice_Folderbatch_renamelocation2
- CD /D "%Loc1Dir%"
- FOR /R %%F IN ("*-*.txt") DO CALL :copyFile %%~F %%~NXF
- GOTO: EOF
- :copyFile
- SET copyfname=%~1
- SET fname=%~2
- SET fname=%fname:-=_%
- ECHO F | XCOPY /Y /F "%copyfname%" "%Loc2Dir%%fname%"
- :::XCOPY /Y /F "%copyfname%" "%Loc2Dir%
- :::REN "%copyfname%" "%fname%"
- GOTO :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement