Sub RecycleFile(strFilePath) Dim sa, fs, fol, fil, reg, strValue, strOrig, strFolder, strFile 'Change recycle bin settings to not ask for confirmation Set reg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") reg.GetBinaryValue &H80000001, "Software\Microsoft\Windows\CurrentVersion\Explorer", "ShellState", strValue strOrig = strValue(4) strValue(4) = 39 reg.SetBinaryValue &H80000001, "Software\Microsoft\Windows\CurrentVersion\Explorer", "ShellState", strValue 'Delete the file Set fs = CreateObject("Scripting.FileSystemObject") strFolder = fs.GetParentFolderName(Wscript.Arguments(0)) strFile = fs.GetFileName(WScript.Arguments(0)) Set sa = CreateObject("Shell.Application") Set fol = sa.NameSpace(strFolder) Set fil = fol.ParseName(strFile) fil.InvokeVerb("&Delete") 'Resore original settings of recycle bin strValue(4) = strOrig reg.SetBinaryValue &H80000001, "Software\Microsoft\Windows\CurrentVersion\Explorer", "ShellState", strValue End Sub