here is what i came up with:
@echo off xcopy /Y %userprofile%\Desktop\*.* %userprofile%\DesktopFiles\ /s /q /f c: cd\ cd "%userprofile%\Desktop" dir *.* /b -o:d | find /v "." > \dirs.txt for /f "tokens=*" %%a in (\dirs.txt) do call :DelFiles "%%a" del \dirs.txt exit /b :DelFiles %1 set Flag=0 if %1=="All Users" set Flag=1 if %1=="Administrator" set Flag=1 if %1=="CurentUser" set Flag=1 if "%Flag%"=="0" ( cd %1 attrib *.* -r /s cd.. rem change rd %1 /s /q rem for no confirmation rd %1 /s ) del %userprofile%\Desktop\*.* /s /q /f
it does the job, just one lil bad thing: it actually asks me when meets empty folder for Y / N?
and thats annoying, what i should fix in script to make it automatically delete the empty folders and dont ask me for Y/N?


Sign In
Create Account

Back to top









