_____ waRmZip.wsf v1.1 (Oct 2003) - http://winadmin.sourceforge.net
_____
Utility to clean up/free up space in a folder (and its subfolders),
* compressing files after a certain number of days (with external program)
* rotating files after a certain number of days/above a certain size
* deleting files and/or empty folders after a certain period of time
There are also other scripts there (e.g. waTimer for timing actions and
calculating throughput).
Remarks are welcome!
Regards,
Peter
=
if you would at least clear up, whether there is
a condition checking in your script.
-----
When I wsf drive volumes at night or rollback
per wsf a dir to a fresh boot drive, I will have
to read/check the .txt file for info now;
since over time connectors/cables etc.
went their state.
"Peter Forret" <pe...@forret.com> wrote in message
news:OCATTd7n...@TK2MSFTNGP10.phx.gbl...
Example:
waRmZip.wsf /r /fo:.log "C:\WINNT\system32\Logfiles" /da:30 /ca:14 /log:d
:: compress all .log files older than 14 days, delete all .log files older
than 30 days
If you'd like check if this script can do something for you, check out:
http://winadmin.sourceforge.net/warmzip.html
"name" <nos...@user.com> wrote in message
news:%237j6hY2...@TK2MSFTNGP09.phx.gbl...
> _____ waRmZip.wsf v1.1 (Oct 2003) - http://winadmin.sourceforge.net
> Remarks are welcome!
Not a lot of comments on this Peter. I've been using a similar structural
approach myself since starting heavy use of commandline-focused WSFs:
"template-based" scripts including some boilerplate code to handle common
issues and make calls to things easy for argument validation.
I like the approach of using resources for classic commandline option
information strings; the named argument return methods are rather
interesting as well. One question and one comment item here..
The question is, why aren't you using CDATA tags on the resource,
description, and example strings? You don't need them at present of course,
but in the event of modifications (particularly in the example section)
which would introduce any of the characters &<>, CDATA tags will become a
necessity.
The comment is on your methods for retrieving named values of a particular
type. Those are nice, simple functions that can be thrown in to make coding
easy: I hadn't even thought about using those.
I am now using both; here are a couple of functions I put together for
advanced data 'types' which may appear as argument values as well, and call
usage and exit if the supplied arguments don't fit the required profile.
function NamedPath(switch)
' takes a switch which should have a legitimate filespec
' as its argument; returns an absolute path for the filespec.
' If it cannot be treated as a spec, will show usage and exit.
dim fso: set fso = createobject("Scripting.FileSystemObject")
If WScript.Arguments.Named.Exists(switch) then
On Error Resume Next
NamedPath = fso.GetAbsolutePathName( _
(WScript.Arguments.Named(switch))
If Err.Number <> 0 Then
WScript.Arguments.ShowUsage
WScript.Quit 2
End If
Else
NamedPath = vbNullString
End If
end function
function NamedDate(switch)
' takes a switch which should have a legitimate date
' as its argument; returns a VT_DATE value.
' If it cannot be treated as a VT_DATE, will show usage and exit.
If WScript.Arguments.Named.Exists(switch) then
On Error Resume Next
NamedDate = CDate((WScript.Arguments.Named(switch))
If Err.Number <> 0 Then
WScript.Arguments.ShowUsage
WScript.Quit 2
End If
Else
NamedDate = CDate(0)
End If
end function