登录时将所有文件(夹)从桌面移除

@echo off

whoami

mkdir "%USERPROFILE%\olddesktop"

Move /Y "%USERPROFILE%\desktop\*.*" "%USERPROFILE%\olddesktop"

Move /Y "%USERPROFILE%\desktop\" "%USERPROFILE%\olddesktop\"

dir /B "%USERPROFILE%\desktop\" > %USERPROFILE%\directory.txt

for /F "tokens=*" %%b in ('type %USERPROFILE%\directory.txt') do move /Y "%USERPROFILE%\desktop\%%b" "%USERPROFILE%\olddesktop\%%b" 

attrib +r "%USERPROFILE%\desktop" /S /D

del "%USERPROFILE%\directory.txt"

exit

 

你可能感兴趣的:(文件)