Results 1 to 15 of 15

Thread: "Path Not Found" error

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Resolved "Path Not Found" error

    I am using the following code to move a file from one location (locally) to another location on the network, but it generates a "Path Not Found" error.
    But if I type the paths into the "Run" box, it opens the locations just fine.

    Any ideas??

    cstrPrinterPath = "C:\MyFolder"
    VB Code:
    1. fso.MoveFile cstrPrinterPath & "\" & strFileName, "\\NetworkShare\MyFolders\PDFCatalogs\November\" & strNewFileName
    Last edited by Memnoch1207; Nov 5th, 2004 at 10:53 AM.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Try using ordinary FileCopy instead. Also, check what values strNewFileName and strFileName currently have and perhaps security settings for that network folder.

  3. #3

  4. #4

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    It appears to be an issue with the local path, rather than the network path.

    the cstrPrinterPath & "\" & strFileName = "C:\PDFFolder\Seagate Crystal Reports ActiveX.pdf"

    When I copy it into the "RUN" box, it generates the following error.

    Windows cannot find 'C:\PDFFolder\Seagate'
    It isn't reading the entire file name, it stops at the first space.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Strange but I was able to replicate your problem using FSO.
    There was no problem what-so-ever when FileCopy was used.

  6. #6

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    I'm getting the same error "Path Not Found" when using fso.MoveFile or FileCopy.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  7. #7
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Try puting it between single or double quotes.

  8. #8

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    I already tried that too.

    Even when I hard code the path, like below, it still generates a "Path Not Found" Error.
    VB Code:
    1. fso.MoveFile "C:\PDFFolder\" & strFileName, "C:\PDFFolder\" & strNewFileName
    All the above line of code should do is rename the file from "Seagate Crystal Reports ActiveX.pdf" to "Test.pdf".
    But it still generates the error...and yes, I do have a folder named "PDFFolder" on my C:
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  9. #9
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Is that folder hidden by any chance?
    Also, do you have all rights to read/write despite it's your own system?

  10. #10
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Have you tried this:

    VB Code:
    1. Name "C:\PDFFolder\" & strFilename As "C:\PDFFolder\" & strNewFileName
    Frans

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    can you open the destination folder from the RUN box? That would cause problems if the folder isn't shared.

  12. #12
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Try shell xcopy

    xcopy "C:\Sample with space.txt" "\\Maya\Target Dir\Sample with space.txt"

  13. #13
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    I just tried a copy from the command prompt. It works as long as the destination folder exists.

    Code:
    copy "t est.txt" "\\192.168.1.4\c$\new folder\new test.txt"
    even when renaming the file.

    you need to tell it which drive you are using...

  14. #14

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    This has been resolved.
    The strNewFileName is the persons name they entered into the survey.
    Unfortunately some of them are morons and put parentheses and slashes in their names, which was causing the code to blow up!
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  15. #15

Posting Permissions

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



Click Here to Expand Forum to Full Width