May 5, 200818 yr 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
May 6, 200818 yr Author 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, 200818 yr by Daimao
May 6, 200818 yr 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
Create an account or sign in to comment