• Kill Files With Spaces In Name

    Author
    Topic
    #462774

    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

    Viewing 0 reply threads
    Author
    Replies
    • #1178875

      Try specifying the full path:

      Kill “C:MyFolderMySubfolderCopy of*.xls”

      • #1178878

        Try specifying the full path:

        Kill “C:MyFolderMySubfolderCopy of*.xls”

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

        oPath = “C:MyFolderMySubfolder”
        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

        • #1178880

          I tried it on my PC, and it worked fine with spaces in the file name.
          Are some of the files read-only, perhaps?

          • #1178882

            I tried it on my PC, and it worked fine with spaces in the file name.
            Are some of the files read-only, perhaps?

            Great observation! Now I’m embarrassed.

            I removed the read-only and it worked.

            Thanks again.
            John

    Viewing 0 reply threads
    Reply To: Kill Files With Spaces In Name

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: