• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3232
  • Last Modified:

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

  • 5
  • 5
1 Solution
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
WEBINAR: GDPR Implemented - Tips & Lessons Learned

Join the WatchGuard team on Thursday, March 29th as we recount some valuable lessons learned in weighing the needs of a business against the new regulatory environment, look ahead at the two months left before implementation, and help you understand the steps you can take today!

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.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now