@echo off
set Ipath=
for /f "tokens=1 delims=" %%a in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal^|Findstr /i "Personal"') do (
set Ipath=%%a&&goto :getpath
)
:getpath
set Ipath=%Ipath:REG_SZ=%
set Ipath=%Ipath: =%
set Ipath=%Ipath: =%
set Ipath=%Ipath:~8%
copy "%Ipath%\*.txt" "%userprofile%\桌面\BAK\"