Hi
With the Robocopy command of Windows 8.x, how do I do a copy of a file (renaming it) in the same directory of the source file?
Thanks
Bye
[Win 8.x] Robocopy and same directory
Moderator: DosItHelp
Re: [Win 8.x] Robocopy and same directory
Code: Select all
@echo off
set "dir=D:\Test"
set "source=example.txt"
set "dest=new.txt"
pushd "%dir%"
>nul robocopy . temp "%source%"
>nul move "temp\%source%" "%dest%"
rd temp
popd
exit /b