Results 1 to 14 of 14
  1. #1
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Cannot find the specified File (Win XP)

    Hi Lounge,

    I have use Excel VBA to create folders on my desktop using the code
    sdate = Format(Date, "mm-dd-yyyy ")

    Dir2 = "G:Calfrac 2003OperationsCementCement Dispatch" & sdate & ""

    MkDir (Dir2)

    This worked great.
    After runnig this for about 3 months, I went through the created directory to clean it by a simple delete of the file if it was older then 2 months.

    when I try to delete the folder named: Format(Date, "mm-dd-yyyy ")

    I get the message "Cannot delete file Cannot read from the source disk file"

    I found out that Format(Date, "mm-dd-yyyy ") has a space after the date which is cause an issue.

    any one know how I can delete the file?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot find the specified File (Win XP)

    Why don't you use the complete path (Dir2) when deleting the folder, just like you did when you created it?

  3. #3
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot find the specified File (Win XP)

    I have tried this using the kill method.

    the code gives an error, file is not found.

    for some reason the space at the end of the file name is not liked

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot find the specified File (Win XP)

    Try <code>rmdir</code> instead of <code>kill</code>. Kill is for files, rmdir for folders (directories).

  5. #5
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot find the specified File (Win XP)

    It returns an error message cannot find path

    code:

    Sub deletedir()
    Dim adir As String
    adir = "Cocuments and SettingsmallenDesktopDispatch Done Jobs10-19-2006 "
    RmDir adir
    End Sub

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot find the specified File (Win XP)

    Try

    adir = "Cocuments and SettingsmallenDesktopDispatch Done Jobs10-19-2006 "

  7. #7
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot find the specified File (Win XP)

    gives the error cannot find path.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot find the specified File (Win XP)

    I'm stumped. It works for me (I created a folder with a space at the end of the name).
    Are you <big>absolutely</big> sure that there is no spelling error in the name?
    Could you have used a non-breaking space (Alt+0160 with num lock on) instead of a normal space?

  9. #9
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot find the specified File (Win XP)

    http://www.jrtwine.com/Products/DelFXPFiles/

    This site talks a bit about the problem

    i am on a imaged OS system BTW.

    attached is also my code that create the problem, as far as I know.. NO Alt+0160 was used?
    Attached Files Attached Files

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot find the specified File (Win XP)

    As far as I can see (but that's not conclusive), it's a normal space.

    I'm afraid I have no further suggestions, except deleting the folder(s) manually, if possible.

  11. #11
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot find the specified File (Win XP)

    Hans, thanks for trying to help,

    Manually does not work.

  12. #12
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,593
    Thanks
    5
    Thanked 1,059 Times in 928 Posts

    Re: Cannot find the specified File (Win XP)

    Did you try the <img src=/S/free.gif border=0 alt=free width=30 height=15> version of the utility?

    Joe
    Joe

  13. #13
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot find the specified File (Win XP)

    no i am scared not really sure what it does?

    do you think its safe?

  14. #14
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,593
    Thanks
    5
    Thanked 1,059 Times in 928 Posts

    Re: Cannot find the specified File (Win XP)

    It appears to do what the paid version does just a little limited in the number of deletes per execution. The description appears to do what you wish. I have no idea if it is safe as I've never used it. It you are really concerned make a complete system backup before you try it. That way you can always get back to where you are now.

    Joe
    Joe

Posting Permissions

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