|
-
Oct 26th, 2004, 02:55 AM
#1
Thread Starter
Lively Member
Cookie Deleter : Runtime Error 70 : Permission Denied
hello, I'm having a frustrating problem. I'm fairly new to VB...
Info >> Cookie Deleter
Runtime Error >> 70
Comment >> Permission Denied
I'm attempting to write a program that deletes all cookies from my hard drive, yesterday it was working however when I compiled it, it isnt, now im back at the code and it aint working anymore so I really need help cause I dunno any other methods or I'm maybe missing something.
Code:
'On Error Resume Next
Dim LOGONNAME As String
LOGONNAME = Text2.Text
If Text2.Text = "Your Windows Log On Name" Then
MsgBox "You Need To Specify An Windows Logon Name", vbExclamation, "Error"
Else
Kill ("C:\Documents and Settings\" & LOGONNAME & "\Cookies\*.*") 'delete all cookies with wildcard
MsgBox "All Cookies Were Successfully Deleted!", vbInformation, "Successful Deletion"
End If
note: I commented out on error resume next to correct this problem, usually I would have this in to stop it closing upon error however I having trouble fixing this problem, please help, any input welcome, ty
Last edited by Shadows; Oct 26th, 2004 at 07:41 AM.
-
Oct 26th, 2004, 03:07 AM
#2
I think you're trying to delete the cookies from a users folder, that isn't logged in. Either that or, Kill isn't letting you delete files from a Read-Only folder (the cookies folder).
Are you logged on as a user and trying to remove the Administrators cookies?
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Oct 26th, 2004, 03:10 AM
#3
don't have IE open at the time.
-
Oct 26th, 2004, 03:14 AM
#4
Thread Starter
Lively Member
ty for the reply
I am the administrator and only this account exists on my computer, when I installed windows I only made one user(myself) so I know the logged on name is correct
also I forgot to explain, I have this in my form's code
VB Code:
Private Declare Function GetUserName& Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long)
Public Function GetCurrentUser() As String
Dim strUsername As String
strUsername$ = String(200, " ")
GetUserName strUsername, 200
strUsername$ = Trim(strUsername$)
GetCurrentUser = Left(strUsername$, Len(strUsername$) - 1)
End Function
Private Sub Form_Load()
Text2.Text = GetCurrentUser
Text2.Enabled = False
End Sub
Private Sub Label5_Click()
'On Error Resume Next
Dim LOGONNAME As String
LOGONNAME = Text2.Text
If Text2.Text = "Your Windows Log On Name" Then
MsgBox "You Need To Specify An Windows Logon Domain", vbExclamation, "Error"
Else
Kill ("C:\Documents and Settings\" & LOGONNAME & "\Cookies\*.*") 'delete all cookies with wildcard
MsgBox "All Cookies Were Successfully Deleted!", vbInformation, "Successful Deletion"
End If
End Sub
I hope that makes its more clear, btw, thanks for the reply
Last edited by Shadows; Oct 26th, 2004 at 03:24 AM.
-
Oct 26th, 2004, 03:16 AM
#5
Thread Starter
Lively Member
Originally posted by dglienna
don't have IE open at the time.
jst tryed it, it doesnt make any difference
Last edited by Shadows; Oct 26th, 2004 at 04:39 AM.
-
Oct 26th, 2004, 07:40 AM
#6
Thread Starter
Lively Member
weird, if I change this line
VB Code:
Kill ("C:\Documents and Settings\" & LOGONNAME & "\Cookies\*.*") 'delete all cookies with wildcard
to this
VB Code:
Kill ("C:\Documents and Settings\" & LOGONNAME & "\Cookies\*.txt") 'delete all cookies with wildcard
it works
but I dont understand why that works and the full wildcard doesnt > *.*
when I change it to *.txt
it deletes them fine, anyway, solved
-
Oct 26th, 2004, 07:45 AM
#7
You probably cannot delete the index file (index.dat)
-
Oct 26th, 2004, 07:48 AM
#8
Thread Starter
Lively Member
ah yes, that would seen correct as I noticed all cookies are gone and index.dat remains, well spotted:d
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
|