Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Delete one file from folder and subfolders
Name: ToweringInferno Date: August 11, 2009 at 07:30:13 Pacific OS: Windows XP Subcategory: General
Comment:
I am trying to remove one file that keeps on popping up (creating itself) on a share through Vb.
This is what I have:
Dim fso, EpicIcon Dim folder, folderCollection, subFolder, fileCollection
EpicIcon = "Epic.lnk" Set fso = CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder("R:\") Set folderCollection = folder.SubFolders Set fileCollection = folder.Files For Each File In fileCollection fso.Delete (EpicIcon), True Next
Name: Joyfax Server Date: August 11, 2009 at 07:49:04 Pacific
Reply:
For Each File In fileCollection fso.Delete File, True Next
0
Response Number 2
Name: ToweringInferno Date: August 11, 2009 at 07:53:16 Pacific
Reply:
I changed the script a little:
Dim fso, EpicIcon Dim folder, folderCollection, subFolder, fileCollection
Set fso = CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder("R:\") Set folderCollection = folder.SubFolders For Each Folder In folderCollection Set fileCollection = folder.Files For Each File In fileCollection EpicIcon = folder & "\Desktop\Epic.lnk" fso.DeleteFile (EpicIcon), True Next Next
0
Response Number 3
Name: aegis1 Date: August 11, 2009 at 11:32:35 Pacific
Summary: Cannot Delete Temporary files from CD Creation I created a backup CD last week, and now when I boot up my computer I get a "Files have not been written to disk" message. I open it up and find 2 hidde...
Summary: Holy Jesus, long fix. Before hacking the registry to death and trying to access a c:\windows32 directory that isn't there, right click on the directory that the file is in (C:\documentsandsettings\us...
Summary: I posted a message here before but no one seem to solve my problem. Couple days ago I downloaded a file that is not working probably and so I have to delete it. The thing is it won't let me so I went ...