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

@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

 

posted @ 2015-05-13 16:00  dongdonggeorge  阅读(231)  评论(0编辑  收藏  举报