Sounds like you are trying to delete a file that you can't (e.g. it might be in use, or you don't have the necessary permissions)
Cheers Ken From: Damien Solodow [mailto:[EMAIL PROTECTED] Sent: Saturday, 25 October 2008 8:14 AM To: NT System Admin Issues Subject: Vbscript being dumb? I'm trying to make a simple script to delete all files in the users %temp% directory. Here's what I've got: Set objShell = WScript.CreateObject("WScript.Shell") strTempPath = objShell.ExpandEnvironmentStrings("%TEMP%") strPath = strTempPath & "\*.*" Set objFSO = CreateObject("Scripting.FileSystemObject") objFSO.DeleteFile(strPath) When I run the script, it returns "(6, 1) Microsoft VBScript runtime error: Permission denied" If I change the "*.*" to say "*.txt" it works fine. What gives? Note: I'm not really a VBscript person, but I'd rather find a way to make this work so the scripts use the same language then I would to rip them all out and redo them in Kixtart.. Damien Solodow Senior System Administrator Infrastructure Services Group Information Services Indiana Business College [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> Direct - (317) 217-6881 We are the Foundation of how Business Gets Done! ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~
