Avatar of DarthRater
DarthRater
 asked on

Deleting Folders By Group Policy Preference

I have been charged with locking down an envirnoment and the first steps is to delete all data in a users Desktop and Documents. I have created a GPP that works great with XP,

User Configuration>Preferences>Windows Settings>Folders

Delete %USERPROFILE%\Desktop\ and %USERPROFILE%/My Documents. The GPP correctly nukes all folders.

MY issue is with Win 7. The Desktop Variable works fine, but the %USERPROFILE%\Documents fails with an event log error.

The user 'Win7 Documents' preference item in the 'Restriction: Delete Contents of Desk/Docs {8EF922B8-1AF0-44BB-9305-E375F0485DD8}' Group Policy object did not apply because it failed with error code '0x80070091 The directory is not empty.'

I have all the options checked so it shouldn't matter if the destination is empty. On XP it kills everything in the target folder.
Windows Server 2008Active DirectoryWindows 7

Avatar of undefined
Last Comment
motnahp00

8/22/2022 - Mon
motnahp00

Did you specify the other Delete options in your delete preference?
wbsn

There may be an issue with the drive. Try CHKDSK /F in the Start Search box and press Enter.
 
Note: If the folder you are trying to delete is located on a drive that is not your C: drive, add the drive letter to the end of the command. Example: CHKDSK /F E:

If you get an error after running, reboot and to let the scan run. Try to delete again.

HTH
DarthRater

ASKER
@motnahp00

"I have all the options checked so it shouldn't matter if the destination is empty. On XP it kills everything in the target folder."

@wbsn
No. That is not part of the problem.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
motnahp00

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
DarthRater

ASKER
Interesting. I'll give that a shot and report back, thank you.
motnahp00

Trying to think outside the box. I'm still wondering why your GPO didn't work.
DarthRater

ASKER
Yea me too, considering it works very well on XP.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
motnahp00

Maybe this will help. I'm headed to sleep in a bit. I'll follow up with you tomorrow morning.