Answer the question
In order to leave comments, you need to log in
How to delete files from user desktops?
Tell me how to delete files from the user's desktop?
I wrote a batch file, but when I create a batch file in group policy and, roughly speaking, I upload this batch file, it does not work when the computer is turned off, and when I run the script separately, it gives.
Answer the question
In order to leave comments, you need to log in
create in group policyThe GPO already has a whole branch of desktop management, including its lock.
In which GPO branch did you specify the batch file? The user may not have permission to read it.
(hint!) And what if instead of deleting you prevent users from writing to the Desktop folder?
I created a group in the forest, added users, and applied it to the computer and to user configurations. Maybe you need to create a script. What when turning off the computer, run this batch file?
Here is the batch file itself:
@Echo off
shutdown -a
Echo "Attention! The computer will be cleaned up now."
timeout 5 /NOBREAK
echo Search for files and folders.
2>nul (for /f "eol=: tokens=*" %%i in ('WHERE /F /RC:\Users\%username%\Desktop\ *.doc, *.xls, *.pdf, *. tiff, *.png, *.xml., *.cvs, *.git, *.rtf, *.bmp, *.jpeg, *.rar, *.zip, *.xmind') do del %%i)
echo Delete temporary system files.
del C:\Users\%username%\AppData\Local\Temp\* /S /Q
del C:\Users\%username%\Downloads\* /S /Q
del C:\Windows\Prefetch.
del C:\Windows\Temp. /Q
del C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Recent\* /S /Q
del /F /S /Q "C:\Users\%Username%\AppData\Local\Microsoft\ Windows\Temporary Internet Files\*"
shutdown -s -f -t 0
exit /b
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question