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

John Skolits JSkolits at CorporateDataDesign.com
Thu Feb 27 06:57:45 CST 2003


Yea. The file was read only. I used the following code to change the read
only flag. Then killed it.


Dim fs, f
Dim strFileToKill  as String

strFileToKill = "C:\Program Files\Microsoft
Office\ART\Office\msaccess_SR1.exe"

    'Make sure it's read only flag is false
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.GetFile((strFileToKill))
        If f.Attributes And 1 Then
            'File is read only, remove the flag
              f.Attributes = f.Attributes - 1
        End If

        Kill (strFileToKill)



Thanks,

John


-----Original Message-----
From: dba-vb-admin at databaseadvisors.com
[mailto:dba-vb-admin at databaseadvisors.com]On Behalf Of Jim DeMarco
Sent: Thursday, February 27, 2003 7:43 AM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] Simple problem. Can't use Kill


John,

It works there, but you got this working didn't you?

Jim


-----Original Message-----
From: John Skolits [mailto:JSkolits at CorporateDataDesign.com]
Sent: Wednesday, February 26, 2003 10:29 PM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] Simple problem. Can't use Kill


Jim,

Try a folder a few levels down and tell me if it works. Like "c:\Program
Files\Microsoft Office\...."

John

-----Original Message-----
From: dba-vb-admin at databaseadvisors.com
[mailto:dba-vb-admin at databaseadvisors.com]On Behalf Of Jim DeMarco
Sent: Wednesday, February 26, 2003 10:21 PM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] Simple problem. Can't use Kill


Is there a Help button on the error message that might give you some
insight?  I thought the problem might be in the parens or maybe a space in
the path but I tried both and it worked for me (killed an exe in my c:\
folder).

Jim DeMarco

-----Original Message-----
From: dba-vb-admin at databaseadvisors.com
[mailto:dba-vb-admin at databaseadvisors.com]On Behalf Of John Skolits
Sent: Wednesday, February 26, 2003 9:03 PM
To: dba-VB at databaseadvisors.com
Subject: [dba-VB] Simple problem. Can't use Kill


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


****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from HealthSource/Hudson Health Plan
(HS/HHP) that is confidential or privileged.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or use of the contents of this message is strictly prohibited.
If you have received this message in error or are not the named recipient,
please notify us immediately, either by contacting the sender at the
electronic mail address noted above or calling HS/HHP at (914) 631-1611. If
you are not the intended recipient, please do not forward this email to
anyone, and delete and destroy all copies of this message.  Thank You".
****************************************************************************
*******

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com



****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from HealthSource/Hudson Health Plan
(HS/HHP) that is confidential or privileged.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or use of the contents of this message is strictly prohibited.
If you have received this message in error or are not the named recipient,
please notify us immediately, either by contacting the sender at the
electronic mail address noted above or calling HS/HHP at (914) 631-1611. If
you are not the intended recipient, please do not forward this email to
anyone, and delete and destroy all copies of this message.  Thank You".
****************************************************************************
*******

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com





More information about the dba-VB mailing list