Re: RmDir command generates an error 75 - Path/File access error
- From: "Dmitriy Antonov" <no@xxxxxx>
- Date: Tue, 15 Aug 2006 16:04:16 -0400
"Carl Imthurn" <nospam@xxxxxxxxxx> wrote in message
news:eUU16CKwGHA.2204@xxxxxxxxxxxxxxxxxxxxxxx
There are two functions in the application I'm working on where we use the
RmDir command.
This one works exactly as advertised, and has never given us any problems:
'Check to see if this directory exists.
If Dir(cScanning.ScanHoldingDirectory & modUtilities.Username,
vbDirectory) <> "" Then ' this directory exists.
On Error Resume Next
' FYI - cScanning.ScanHoldingDirectory =
"\\MyServer\MyHiddenShare$\"
' modUtilities.Username = "cimthurn"
Kill (cScanning.ScanHoldingDirectory & modUtilities.Username &
"\scan.jpg") ' this file will always exist.
RmDir (cScanning.ScanHoldingDirectory & modUtilities.Username)
End If
This one *always* generates an error 75 - Path/File access error:
LINE NUMBERS ADDED FOR EXPLANATORY PURPOSES ONLY -- NOT IN CODE.
1 'First delete the old jpeg file.
2 On Error Resume Next
' FYI - cScanning.ScanDestinationDirectory =
"\\MyServer\FolderLevel1$\1234567\"
3 Kill (cScanning.ScanDestinationDirectory & OldScanNameIn) ' this file
will always exist
4 On Error GoTo ErrorHandler
5 'Next, check to see if the folder is empty, and if it is, delete it.
6 If Dir(cScanning.ScanDestinationDirectory & "*.*") = "" Then 'the
directory is empty. Delete it.
7 On Error Resume Next
8 Kill cScanning.ScanDestinationDirectory & "*.*"
9 Dir ("c:\")
' ERROR 75 ON THE FOLLOWING LINE
10 RmDir (Left(cScanning.ScanDestinationDirectory,
Len(cScanning.ScanDestinationDirectory) - 1))
End If
Here's everything we've tried so far:
1) Insertion and removal of line 9
2) Insertion and removal of line 8
3) Removal and insertion of trailing "\" in the Left() function in line 10
4) Insertion and removal of the & "*.*" in line 6
5) Change line 9 to Dir
6) Change line 9 to Call Dir$("nul")
7) Close the IDE and re-launch the project (twice)
At this point we're at a loss. Any help will be gratefully accepted.
Thanks --
Carl
One guess I could make is that Kill doesn't delete all files (and it doesn't
delete hidden, system and read-only files). So the simplest check you should
do is to check whether folder is actually empty before that line of code
(#10), making sure that there no hidden files as well. If this is the case
than you'll need to reset all attributes on files before using Kill method.
OT. Never use parentheses, when calling methods - either remove them or use
Call keyword. It might be not important here, but may bite you in other
cases.
Dmitriy.
.
- References:
- RmDir command generates an error 75 - Path/File access error
- From: Carl Imthurn
- RmDir command generates an error 75 - Path/File access error
- Prev by Date: Re: Text on picture
- Next by Date: Re: vb and msxml - encoding conversion is not working
- Previous by thread: RmDir command generates an error 75 - Path/File access error
- Next by thread: Re: RmDir command generates an error 75 - Path/File access error
- Index(es):
Relevant Pages
|