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


  1. Posts : 3
    Windows 7 professional 32bit
       #1

    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 Computer


  2. Posts : 12,012
    Windows 7 Home Premium SP1, 64-bit
       #2

    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 Computer


  3. Posts : 5,092
    Windows 7 32 bit
       #3

    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 Computer


  4. Posts : 12,012
    Windows 7 Home Premium SP1, 64-bit
       #4

    Thanks for that, Miles. I've never heard of that and never been in such a situation.
      My Computer


  5. Posts : 5,092
    Windows 7 32 bit
       #5

    ignatzatsonic said:
    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 Computer


  6. Posts : 4,049
    W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
       #6

    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 Computer


  7. Posts : 3
    Windows 7 professional 32bit
    Thread Starter
       #7

    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 Computer


  8. Posts : 1,781
    Windows 7 Professional SP1 32-bit
       #8

    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 Computer


  9. Posts : 3
    Windows 7 professional 32bit
    Thread Starter
       #9

    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 Computer


  10. Posts : 1,781
    Windows 7 Professional SP1 32-bit
       #10

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 04:28.
Find Us