[dba-VB] Simple problem. Can't use Kill

John Skolits JSkolits at CorporateDataDesign.com
Wed Feb 26 20:02:30 CST 2003


Am I losing it?

Why doesn't the Kill statement work in this code.


'*********
Dim strRuntimePath  as string

strRuntimePath ="C:\Program Files\Microsoft Office\ART\Office"

If Len(Dir(strRuntimePath & "\msaccess_SR1.exe")) > 0 Then 
   Kill (strRuntimePath & "\msaccess_SR1.exe")
End If
'************


The line with "Len(Dir" in it works fine. Bu when the Kill line tries to run
I get an error 75 ("Path/File access error")

I can easily rename the file and move it around in explorer so I know it's
not being used by anything. I've used this syntax before in other VB apps
with no problem.

If I rename the file through explorer and run that line again it says Error
53 :File Not Found". Which makes perfect sense.

Is it because it's an EXE file?

Am I missing something really obvious?

John Skolits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 1908 bytes
Desc: not available
URL: <http://databaseadvisors.com/pipermail/dba-vb/attachments/20030226/e7535f56/attachment-0002.bin>


More information about the dba-VB mailing list