How to create a batch or vbs file to delete all the system files in a folder?

I'm trying to create a script that will delete all of the files in the below folder.
C:\Users\[Current User]\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content

I tried this with no success.
del /f /q "%userprofile%\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content\*."
kbay808Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
That would only delete files with no extension, try:

del /f /q "%userprofile%\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content\*.*"

~bp
0
kbay808Author Commented:
I tried that, but it did not work for system files.  Please see the attached screen shot.
Screen-Shot.JPG
0
Bill PrewCommented:
You may need to run this with elevated administrator privileges.

~bp
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

kbay808Author Commented:
I tried to run it as an administrator, but no joy.  I even tried it on a test file on my desktop and still no joy.  I attached a copy of the test file.

@echo off 
del /f /q "%userprofile%\Desktop\Test Delete\*."

Open in new window

Test-Delete.zip
0
Bill PrewCommented:
Ah, I see now, those are "system" files, so you will need to do the following.  Not sure if you will need admin privs, I suspect so, but try without first.

del /f /q /a:s "%userprofile%\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content\*.*"

~bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kbay808Author Commented:
Thanks!!!   That worked great!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.