Computing.Net > Forums > Programming > VBS script to delete files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBS script to delete files

Reply to Message Icon

Name: djfox1
Date: October 25, 2006 at 17:56:50 Pacific
OS: XP
CPU/Ram: NA
Product: NA
Comment:

Can any script gurus tell me why the following VBS script doesn't run at all on my XP box? It's supposed to echo all files newer than the specified date, but when I run it, I just get a command window and a blinking c:\ prompt:
---
strDate = "20061001000000.000000+000"

strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_DataFile Where CreationDate > '" & strDate & "'")
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next
---

Thanks,
Dave



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VBS script to delete files

VB Script for deleting files www.computing.net/answers/programming/vb-script-for-deleting-files-/16904.html

VBS script to shorten file name www.computing.net/answers/programming/vbs-script-to-shorten-file-name/19993.html

VB Script to ftp files www.computing.net/answers/programming/vb-script-to-ftp-files/17951.html