Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: help me w/ cmd prompt- invalid argument/option- 'Files\....\...'

20 Nov 2011   #1
minnow666

Windows 7 professional 32bit
 
 
help me w/ cmd prompt- invalid argument/option- 'Files\....\...'

because of something unknown AVG stopped working for me, and i can't uninstall it normally because some files were missing... now i am trying to just delete everything manually in command prompt, except access is denied, so i must run a takeown command and a cacles command (? right).

k, so here's the problem:

when in command prompt i type... takeown /f c:\program files\avg\avg2012\avgsysx.dll

it returns with ERROR: Invalid Argument/Option - 'files\avg\avg2012\avgsysx.dll'

i am assuming that it's because there is a space in program files, i've tried typing it as c:\program_files\.... and c:\program%files.... but neither works... anybody? anything?

thanks p


My System SpecsSystem Spec
.

20 Nov 2011   #2
ignatzatsonic

Microsoft Community Contributor Award Recipient

Windows 7 SP1, Home Premium, 64-bit
 
 

I've never used takeown, but...

are you trying to run this from c:\ ?????

can you instead navigate (change directories) to a prompt at C:\program files\avg\avg2012 and then just run takeown /f avgsysx.dll?

Or can you temporarily move or copy avgsysx to c:\temp and then run the command and then copy it back to avg folder if necessary?
My System SpecsSystem Spec
20 Nov 2011   #3
MilesAhead

Windows 7 32 bit
 
 

Quote:
takeown /f c:\program files\avg\avg2012\avgsysx.dll
On the command line if a path has any spaces in it, you have to wrap it in double quotes.
For example to run c:\program files\myprog.exe from the command line I have to type
"c:\program files\myprog.exe"

Note the double quotes.
takeown /f "c:\program files\avg\avg2012\avgsysx.dll"
My System SpecsSystem Spec
.


20 Nov 2011   #4
ignatzatsonic

Microsoft Community Contributor Award Recipient

Windows 7 SP1, Home Premium, 64-bit
 
 

Thanks for that, Miles. I've never heard of that and never been in such a situation.
My System SpecsSystem Spec
20 Nov 2011   #5
MilesAhead

Windows 7 32 bit
 
 

Quote   Quote: Originally Posted by ignatzatsonic View Post
Thanks for that, Miles. I've never heard of that and never been in such a situation.
That's one of my Windows pet peeves is spaces in paths. Makes for a lot of messy programming. But we're stuck with it. Might be a good trivia question what version of Windows/Dos first allowed spaces in paths?

I don't remember myself it's been so long.
My System SpecsSystem Spec
20 Nov 2011   #6
lehnerus2000

Windows 7 Ultimate SP1 (64 bit), Linux Mint 17.1 MATE (64 bit)
 
 

Sometimes you need to use multiple sets of double quotes (").

For example, if the path has spaces AND you wish to execute a program with switches (I think this is the correct syntax. I can't find the batch file that I had to do this in):
cmd /k ""path\program.exe" switches"
My System SpecsSystem Spec
21 Nov 2011   #7
minnow666

Windows 7 professional 32bit
 
 

thanks miles that solved the space problem, now able to take ownership but still can't delete,
so i'll run >Icacls "c:\program files\avg\avg2012\avgsysx.dll g/ username:f"
which returns success 0 fail 1........boo, well at least we solved the spacing?

i am understanding that i have taken ownership of the file, now i can grant myself full permissions with icacls command (my query turned up the cacls command but my cmd prompt says Note: Cacls is now deprecated, please use Icacls) so that i can delete the file... any more suggestions? prolly try it out in safe mode tomorrow
My System SpecsSystem Spec
21 Nov 2011   #8
Corazon

Windows 7 Professional SP1 32-bit
 
 

Only include the path/filename within quotes, not the name and all the arguments. The command should look like this:

icacls "c:\program files\avg\avg2012\avgsysx.dll" /g username:f

But you also can make life much easier on yourself with this tutorial: Take Ownership Shortcut

Or try AVG's own cleanup tools here: http://www.avg.com/ww-en/utilities - might save you a lot of work, or at least get most of it done for you.
My System SpecsSystem Spec
21 Nov 2011   #9
minnow666

Windows 7 professional 32bit
 
 
solved

thanks all for the help, in the end i had to boot up safe mode w command prompt to finally delete these files and get the icacls command to work. thx
My System SpecsSystem Spec
22 Nov 2011   #10
Corazon

Windows 7 Professional SP1 32-bit
 
 

Glad you were successful in the end. To make sure that your system really is free of any and all AVG remnants, I still recommend downloading the AVG cleanup tool I linked to in my previous post - especially because of the registry keys left behind.

Then grab a solid replacement antivirus such as avast! or better yet, Microsoft Security Essentials.
My System SpecsSystem Spec
Reply

 help me w/ cmd prompt- invalid argument/option- 'Files\....\...'




Thread Tools





Similar help and support threads
Thread Forum
Invalid Key after HDD replaced, no phone activation option available
Hello. My HDD was failing so I replaced it. I installed Windows on this (using a disc I had downloaded & burned from the Microsoft website) and when I put in my product key (from the sticker on the side of my PC) it tells me it's invalid. I've tried to use the Phone Activation method but when I run...
Windows Updates & Activation
Dell Factory Settings isn't option - command prompt?
I think I'm selling this thing to someone who knows how to fix computers and buying myself a new one. Thus, I need to restore it to factory settings. However, the Dell Image Restore option does not appear when I click Repair. Is there a command code I can use? I have Windows 7 Home Premium 64-Bit.
Backup and Restore
Command-line Argument for Admin Rights
I am enjoying Windows 7, but because of some relatively simple disagreements I have with the interface, I've installed litestep as my shell, which I was very comfortable using in previous versions of Windows. Aero and the new and improved task bar just don't cut it for me. The biggest difference I...
System Security
Adding "Open Command Prompt" Option
Hey guys, I know there's a way to add a "Open command window here" when you click ON a folder... but what I'm curious about is if there's a way to do that if you're IN a folder. It never made sense to me, if I want to run a command-line utility like ffmpeg on a file, to have to go up a folder,...
Customization
webpage error - invalid argument
i am using Internet explorer, for a change - I used Firefox, for the past 5 years, up until last week. When Gmail started dropping my text (and addressee) on sending messages. (another unresolved issue, but probably off topic of W7 users). I have made a real effort to troll through here, to see if...
Browsers & Mail
can someone settle a Win7 reinstall argument?
Alright, can someone settle an argument? I've been doing battle with a "computer-guru" friend since 7 was released for retail that claims any version of 7 can be re-installed, "as new, first time" on a different computer 120+ days after being activated, just like XP can. I told him "not true",...
Installation & Setup

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 15:57.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App