Windows 7 Forums


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

20 Nov 2011  
minnow666

Windows 7 professional 32bit
3 posts
 
 
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  
ignatzatsonic

Windows 7 SP1, Home Premium, 64-bit
7,566 posts
 
 

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  
MilesAhead

Windows 7 32 bit
3,135 posts
 
 

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  
ignatzatsonic

Windows 7 SP1, Home Premium, 64-bit
7,566 posts
 
 

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

Windows 7 32 bit
3,135 posts
 
 

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  
lehnerus2000

Windows 7 Ultimate SP1 (64 bit), Windows XP SP3, Linux Mint 14 MATE (64 bit)
1,849 posts
Adelaide
 
 

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  
minnow666

Windows 7 professional 32bit
3 posts
 
 

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  
Corazon

Windows 7 Professional SP1 32-bit
1,784 posts
Fantasyland
 
 

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  
minnow666

Windows 7 professional 32bit
3 posts
 
 
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  
Corazon

Windows 7 Professional SP1 32-bit
1,784 posts
Fantasyland
 
 

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\....\...' problems?



Thread Tools



Similar help and support threads for: help me w/ cmd prompt- invalid argument/option- 'Files\....\...'
Thread Forum
Back up files from dvd doesnt prompt for disc 2 Backup and Restore
Adding "Open Command Prompt" Option Customization
Extracting files from an executable with the command prompt General Discussion
Bluetooth Problem " An invalid Argument was supplid " Hardware & Devices
webpage error - invalid argument Browsers & Mail


All times are GMT -5. The time now is 10:12 PM.



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