Daimao Posted May 5, 2008 Posted May 5, 2008 I need a script to delete a certain folder in all users/start menu/programsand it has to be language independentthx to whoever helps me
Daimao Posted May 6, 2008 Author Posted May 6, 2008 (edited) This should work thenConst SMP = &H17&Set oShell = CreateObject("Shell.Application")Dim fso Set fso = CreateObject("Scripting.FileSystemObject")Set oFolderItem = oShell.Namespace(SMP).Self fso.DeleteFolder oFolderItem.Path & "\RA", true Edited May 6, 2008 by Daimao
gunsmokingman Posted May 6, 2008 Posted May 6, 2008 Here is the same script except I added a check to see if the folder exists. Const SMP = &H17& Dim Fso, oShell,oFolderItem, Target Set oShell = CreateObject("Shell.Application") Set Fso = CreateObject("Scripting.FileSystemObject") Set oFolderItem = oShell.Namespace(SMP).Self'/-> Replace Your_Folder_Name With The Name Of The Folder Target = oFolderItem.Path & "\Your_Folder_Name" If Fso.FolderExists(Target) Then Fso.DeleteFolder(Target) Else MsgBox "This folder does not exists" & vbCrLf & Target,4128,"Missing Folder" End If
Daimao Posted May 6, 2008 Author Posted May 6, 2008 Thank youI don't know any VB at all so all help was welcome ^^
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now