I
I
Igor Krivintsov2017-05-31 19:38:33
System administration
Igor Krivintsov, 2017-05-31 19:38:33

How to clean up the desktop?

Hello, tell me how to write a bat file that would clear the user's desktops?
Path to desktops E:\Redirection\a.koralev\Desktop Preset
del
/f /s /q E:\Redirection\"%USERPROFILE%\Desktop\

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Tsvetkov, 2017-05-31
@tsklab

toster.com

S
Stalker_RED, 2017-05-31
@Stalker_RED

If you need to demolish all folders and files from the current user, then

cd /d %USERPROFILE%\Desktop
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)

If you need to iterate through the list of users, then you first need the list itself, then loop through it.

A
Andrey Levchenko, 2017-05-31
@Andrew_Fox

The main thing is that the antivirus does not block it.
He loves those files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question