5 replies
by bfilmfan
Assuming a Microsoft OS. Try this:
If you just want to delete everything in a certain directory, you could create a batch file containing the del *.* command and schedule it periodically. Open notepad (start -> run -> notepad) type in "del c:\tmp\*.*" (substituting the proper path) and save as a batch file (.bat extension, not .txt). Or you could write a vbscript if you need a little more flexibility, for example, you could open notepad and copy the following script (which deletes everything in a certain directory that was created more than one week) into it and save as a vbscript (.vbs extension, not .txt).
'*************************************************************************
'*************************************************************************
dim aweekago
dim dir
dir = "c:\tmp"
aweekago = date -7
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder(dir)
For Each file In fldr.Files
If file.datecreated < aweekago then file.delete
Next
'*************************************************************************
'*************************************************************************
Sure, you can automate either one (.bat or .vbs) through scheduled task. Start -> Settings -> Control Panel -> Scheduled Tasks -> Add Scheduled Task. Or you can assign it through the "AT" command as well. Just go to a command prompt (Start -> Run -> cmd) and type "at /?" to see a full description of the command and its parameters. The AT command is helpful, because you can easily schedule tasks on remote machines as well.
by justaperson
by tonythetiger
Some ideas.
You could do a "net view" redirected to a text file which will give you a list of computernames in the domain. Then make a batchfile doing what you want to each machine and run it on each machine (from an administrator's machne) with "FOR /L" to read the machinenames from the file you created.
From a command prompt, type FOR /? for details on how to use the command.
by justaperson
Poster rated this answer.
by justaperson
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending