invalid parameter using icacls in command prompt

im trying to delete a file (folder actually) from my computer - vista o/s.

im getting a "destination folder access denied" error message.

i went to command prompt and used the "takeown" command to take ownership and got this message:

success:  the file <or folder>: "c:\downloads\myfolder" now owned by user "myname-pc\myname".

now im trying to use the icacls command to assign full access so i can delete the folder but i keep getting an "invalid parameter" error message referring to the user name.

attempted command/syntax is as follows:

c:\downloads>icacls myfolder/g myname-pc\myname:f

which brings error message: invalid parameter myname-pc\myname:f


c:downloads>icacls myfolder/g myname-pc\myname: f

which brings error message: invalid parameter myname-pc\myname:

is my syntax incorrect or is there something about the user name or something else?

fyi:  commands under command prompt were run as administrator.

in the infamous words of christine mcvie:  "im over my head....."

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.

Dan CraciunIT ConsultantCommented:
Please try
ICACLS myfolder /grant administrators:F /t
qt3dot14Author Commented:
i tried your suggestion and it worked to a point.  after running the command i got a message that said something to the effect of "items successfully processed 124, items failed to process 0".

but when i try to delete the folder i still get the "destination folder access denied" error message.

i cant delete the folder, i cant rename the folder and i can open the folder to see its contents but i cant execute anything in the folder.

any suggestions?
Dan CraciunIT ConsultantCommented:
The command you ran gave the group "administrators" full access rights on that folder. Is the user account you're running an administrator account? If not, switch to an administrator account and you should be able to delete the folder.

Or, run
ICACLS myfolder /grant myname-pc\myname:F /t
to give full access to the user "myname-pc\myname"

Or, from an elevated command prompt, run

rmdir C:\downloads\myfolder /S
10 Holiday Gifts Perfect for Your Favorite Geeks

Still have some holiday shopping to do for the geeks in your life? While toys, clothing, games, and gift cards are still viable options for your friends and family, there’s more reason than ever to consider gadgets and software.

qt3dot14Author Commented:
im running under an admin account.  

just to be thorough i ran command prompt with a right-click <run as administrator>.

i tried both of the above commands and they both seemed successful but i still get the "destination folder access denied" error message.

if this helps:  the folder is actually called techtools and was installed by avast online during a "computer clean-up" session.  they didnt delete the folder before they logged out.

also, do i need to be restarting my computer at any point during this process?  i dont think so but its better to ask.

i will be out of town for a few days so i wont be able to respond to your comments for those days.  so dont think ive abandoned this question.  i have this, or a similar issue, on a few other files stored on a zip drive so i definitely want to find out the answer.  

also, when i get back, if you need any screen shots to help facilitate this process i'll be happy to provide those.

thanx for you help so far.
Dan CraciunIT ConsultantCommented:
When you ran the last command (rmdir) you did not get an error message? Cause that command deletes the folder, but that won't reflect on Windows Explorer until you hit F5.

When you return, please post the following screenshots of the techtool folder properties:
1. the general properties page (right click->properties)
2. the security properties page (right click->properties->security)
3. the advanced security permissions page (right click->properties->security->advanced)
4. the advanced security owner page (right click->properties->security->advanced->owner)

This should help clear the issue.

A reboot might help if Avast or another program still uses this folder.
That might explain why you can't delete it.
Dan CraciunIT ConsultantCommented:
Rereading your original question, what was the command you used to take ownership of the folder?

The correct syntax is:
TAKEOWN /f c:\downloads\techtools /r /d y

The important part is the /r flag. It means "do a recursive operation and take ownership on all files in the specified directory and subdirectories"
Without it you only take ownership of the folder.

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
qt3dot14Author Commented:
when i try to delete folder i get the "destination folder access denied" message, as i previously stated.

as of this moment i have decided that i would rather just change the name of the folder and move it to another location.

when i try to rename the folder i get the same "destination folder access denied" message.  so there is some type of ownership problem.

i have restated all this so that you understand that i would prefer to take ownership/control of the file without deleting the file thru the command prompt.

that being said i will now attempt to provide you with the screen shots so that i can call upon your expertise to help me achieve my goal.

screenshots are in the attached wordpad file.

thanx again for the help.

update:  it is not letting me upload the wordpad file, so im going to post this message and then try to upload the file on a follow-up message.
Dan CraciunIT ConsultantCommented:
Did you try the command from my previous post?

TAKEOWN /f c:\downloads\techtools /r /d y

What was the result?
qt3dot14Author Commented:
im in north carolina and its late and im fading fast.

ill try that first thing in the morning and let you know what happens.  if that command doesnt work ill try to re-post the screen shots that i cant get uploaded at the moment.

qt3dot14Author Commented:
my computer has crashed so the answer to this question is moot at the moment.  if i get it back running i will re-contact you to pursue the issue further.  thanx for your help dan.
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
Microsoft Legacy OS

From novice to tech pro — start learning today.