Computer Games Forum

Go Back   Computer Games Forum > Tech > Software

Notices

Reply
 
LinkBack Thread Tools
Old 26-05-2006, 10:28   #1 (permalink)
Moderator
 
droopy's Avatar
 
Join Date: Jul 2003
Location: Tragic Kingdom
windows scripting <insert outrageous comment here>

Va prezint cod extras din Hey, Scripting Guy!

[code]Hey, Scripting Guy! I’d like to have a script that can search my
computer for all files older than a certain date, and then automatically
delete those files. Can I do that?


strDate = "20031102000000.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
[/code]

Acu, ce-i fac eu liniei asteia sa se uite doar intr-un singur director nu sa-mi
caute ca tampita peste tot.
[code]
("winmgmts:\\" & strComputer & "\root\cimv2")
[/code]
Sau altfel, cine ii da calea? Asta cumva?
strComputer = "."
__________________
It has been said that the contents of the rules sections of sendmail.cf most closely resemble the effect of line noise on a non-error-correcting modem. It has also been said that capturing such line noise into a text file has about as much chance of resulting in a working sendmail.cf as does any attempt to actually edit that file.
Romania, the land of "sunt obisnuit cu 10-11MB si imi vine greu cu 5,7M"

Last edited by droopy; 26-05-2006 at 14:36..
 
droopy is offline    Reply With Quote
Old 26-05-2006, 15:38   #2 (permalink)
Bean Bachine
 
Comanche's Avatar
 
Join Date: Sep 2004
Location: Bucuresti
Întrebarea mea e unde face ştergerea?
Şi a doua: ce reprezintă winmgmts:// ?
__________________
d*L*b
 
Comanche is offline    Reply With Quote
Old 26-05-2006, 20:20   #3 (permalink)
Moderator
 
droopy's Avatar
 
Join Date: Jul 2003
Location: Tragic Kingdom
> Wscript.Echo objFile.Name
s/Echo/Delete sau ceva in gen. Vezi la MS pe site.

winmgmts:// cheama WMI-ul.

__________________
It has been said that the contents of the rules sections of sendmail.cf most closely resemble the effect of line noise on a non-error-correcting modem. It has also been said that capturing such line noise into a text file has about as much chance of resulting in a working sendmail.cf as does any attempt to actually edit that file.
Romania, the land of "sunt obisnuit cu 10-11MB si imi vine greu cu 5,7M"
 
droopy is offline    Reply With Quote
Advertisment
jocuri prin smsCumpără jocuri prin SMS

Rapid si sigur!
Reply

  Computer Games Forum > Tech > Software

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +2. The time now is 08:19.


This site is copyrighted ©1997 - 2009, Computer Games Online SRL