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\*."
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 PrewIT / Software Engineering ConsultantCommented:
That would only delete files with no extension, try:

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

kbay808Author Commented:
I tried that, but it did not work for system files.  Please see the attached screen shot.
Bill PrewIT / Software Engineering ConsultantCommented:
You may need to run this with elevated administrator privileges.

Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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
Bill PrewIT / Software Engineering ConsultantCommented:
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\*.*"


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!!!
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.