![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Unable to delete a read only file Hello I'm logged in as local admin, and i'm trying to delete a file that is marked Read Only If (fso.FileExists("C:\afdxcfg.bin")) Then Set MyFile = fso.GetFile("C:\filename.bin") Myfile.Delete End If For some reason I still get a access denied error. Any ideas |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Unable to delete a read only file On Jul 23, 4:32*pm, "Jason" <nos...@xxxxxx> wrote: Quote: > Hello > > I'm logged in as local admin, and i'm trying to delete a file that is marked > Read Only > > *If (fso.FileExists("C:\afdxcfg.bin")) Then > * * Set MyFile = fso.GetFile("C:\filename.bin") > * * Myfile.Delete > * End If > > For some reason I still get a access denied error. > > Any ideas to remove the read-only status, as in ... If (fso.FileExists("C:\afdxcfg.bin")) Then Set MyFile = fso.GetFile("C:\filename.bin") Myfile.Attribute = 0 ' resets all attributes to off Myfile.Delete End If Tom Lavedas *********** |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Unable to delete a read only file On Jul 23, 4:40*pm, Tom Lavedas <tglba...@xxxxxx> wrote: Quote: > On Jul 23, 4:32*pm, "Jason" <nos...@xxxxxx> wrote: > Quote: > > Hello Quote: > > I'm logged in as local admin, and i'm trying to delete a file that is marked > > Read Only Quote: > > *If (fso.FileExists("C:\afdxcfg.bin")) Then > > * * Set MyFile = fso.GetFile("C:\filename.bin") > > * * Myfile.Delete > > * End If Quote: > > For some reason I still get a access denied error. Quote: > > Any ideas > Have you tried doing the obvious? - That is resetting the attributes > to remove the read-only status, as in ... > > *If (fso.FileExists("C:\afdxcfg.bin")) Then > * * Set MyFile = fso.GetFile("C:\filename.bin") > * * Myfile.Attribute = 0 ' resets all attributes to off > * * Myfile.Delete > * End If > > Tom Lavedas > *********** Tom Lavedas *********** |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Unable to delete a read only file Thanks, got it. "Tom Lavedas" <tglbatch@xxxxxx> wrote in message news:bc0effaf-d9b8-4472-9377-12810bc73184@xxxxxx On Jul 23, 4:40 pm, Tom Lavedas <tglba...@xxxxxx> wrote: Quote: > On Jul 23, 4:32 pm, "Jason" <nos...@xxxxxx> wrote: > Quote: > > Hello Quote: > > I'm logged in as local admin, and i'm trying to delete a file that is > > marked > > Read Only Quote: > > If (fso.FileExists("C:\afdxcfg.bin")) Then > > Set MyFile = fso.GetFile("C:\filename.bin") > > Myfile.Delete > > End If Quote: > > For some reason I still get a access denied error. Quote: > > Any ideas > Have you tried doing the obvious? - That is resetting the attributes > to remove the read-only status, as in ... > > If (fso.FileExists("C:\afdxcfg.bin")) Then > Set MyFile = fso.GetFile("C:\filename.bin") > Myfile.Attribute = 0 ' resets all attributes to off > Myfile.Delete > End If > > Tom Lavedas > *********** Tom Lavedas *********** |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Unable to delete a read only file Another even more obvious option: FSO.DeleteFile "C:\File.txt", True Quote: > Hello > > I'm logged in as local admin, and i'm trying to delete a file that is Quote: > Read Only > > If (fso.FileExists("C:\afdxcfg.bin")) Then > Set MyFile = fso.GetFile("C:\filename.bin") > Myfile.Delete > End If > > For some reason I still get a access denied error. > > Any ideas > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Batch Commands To Read and Delete Lines from txt-File | PowerShell | |||
| Unable to read / move / delete file with admin rights | Vista file management | |||
| Unable to read or Delete Mail | Vista mail | |||
| Backup - unable to read file or directory | Vista General | |||
| Unable to delete unread messages that have been read | Vista mail | |||