|
-
Nov 2nd, 2004, 10:25 AM
#1
Thread Starter
Frenzied Member
"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:
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
-
Nov 2nd, 2004, 11:21 AM
#2
Try using ordinary FileCopy instead. Also, check what values strNewFileName and strFileName currently have and perhaps security settings for that network folder.
-
Nov 2nd, 2004, 11:37 AM
#3
Does the "to" folder alreay exist? From what I've read you can't create a new folder on another server.
-
Nov 3rd, 2004, 09:53 AM
#4
Thread Starter
Frenzied Member
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
-
Nov 3rd, 2004, 10:05 AM
#5
Strange but I was able to replicate your problem using FSO.
There was no problem what-so-ever when FileCopy was used.
-
Nov 3rd, 2004, 10:32 AM
#6
Thread Starter
Frenzied Member
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
-
Nov 3rd, 2004, 12:21 PM
#7
Try puting it between single or double quotes.
-
Nov 3rd, 2004, 04:56 PM
#8
Thread Starter
Frenzied Member
I already tried that too.
Even when I hard code the path, like below, it still generates a "Path Not Found" Error.
VB Code:
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
-
Nov 3rd, 2004, 05:03 PM
#9
Is that folder hidden by any chance?
Also, do you have all rights to read/write despite it's your own system?
-
Nov 4th, 2004, 02:59 AM
#10
Have you tried this:
VB Code:
Name "C:\PDFFolder\" & strFilename As "C:\PDFFolder\" & strNewFileName
-
Nov 4th, 2004, 03:04 AM
#11
can you open the destination folder from the RUN box? That would cause problems if the folder isn't shared.
-
Nov 4th, 2004, 01:56 PM
#12
Try shell xcopy
xcopy "C:\Sample with space.txt" "\\Maya\Target Dir\Sample with space.txt"
-
Nov 4th, 2004, 02:22 PM
#13
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...
-
Nov 4th, 2004, 05:30 PM
#14
Thread Starter
Frenzied Member
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
-
Nov 4th, 2004, 07:46 PM
#15
Originally posted by Memnoch1207
This has been resolved....
OK, now please edit the first post and add the green checkmark.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|