Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I recall that if one has spaces in file names quote marks should be used in order to Kill the files.

    I'm having a challenge trying to delete all files with: "Copy of*.xls"

    My Example:
    Kill "Copy of*.xls"

    Thanks for taking a look,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try specifying the full path:

    Kill "C:\MyFolder\MySubfolder\Copy of*.xls"

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='795131' date='27-Sep-2009 08:09']Try specifying the full path:

    Kill "C:\MyFolder\MySubfolder\Copy of*.xls"[/quote]


    Han,
    I should have been more clear as to what I'm trying to achieve.

    oPath = "C:\MyFolder\MySubfolder\"
    oEraseFiles = "Copy of*.xls"

    Kill oPath & oEraseFiles


    The error message I receive is "Path/File" access error. I believe this to be related to the space.

    Regards,
    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I tried it on my PC, and it worked fine with spaces in the file name.
    Are some of the files read-only, perhaps?

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='795136' date='27-Sep-2009 08:32']I tried it on my PC, and it worked fine with spaces in the file name.
    Are some of the files read-only, perhaps?[/quote]

    Great observation! Now I'm embarrassed.

    I removed the read-only and it worked.

    Thanks again.
    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •