Pretty good explanation:

 

http://computerperformance.co.uk/ezine/ezine139.htm 

 

From: Damien Solodow [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 24, 2008 5:14 PM
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]

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/>  ~

Reply via email to