Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS on 2003 SP2

Status
Not open for further replies.

dukekern

MIS
Jan 16, 2003
6
US
I have a script that works on SP1 but not on SP2. I get a permission denied error. I run it with admin privileges and I have full permissions to the server and it's directories. What is it about SP2 that won't allow this? Here is the script if it helps:

Dim fso, f, f1, fc
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("D:\Program Files\aaaaa\bb\logfiles")
Set fc = f.Files
For Each f1 in fc
If DateDiff("d", f1.DateLastModified, Now) > 14 Then f1.Delete
Next
 
Well I tested that on my machine and it seems to work. Have you verified you have perms on those files? The files may be in use and that would also give you that error. I have had a few perm issues after installing SP2. Also verify the path and make sure that is correct, it should give you a different error if it is not the correct path.
 
The path is correct and I have admin priviledges so I can't figure it out. I keep coming back to that as well but when I do the exact same script in the same way on my SP1 server, it works fine. The only difference I see is the SP2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top