Tom thanks for your fast reply!
That is exactly what I needed.
For the second question would it be more complicated to have the file
compare utility do a condition process whereby if changes between files are
found it would send an email?
Or would I need something much more involeved to get that kind of
automation?
Thanks again,
Altria
"Tom Lavedas" <> wrote in message
news:2f5dbee6-66ca-4493-ae95-...
On Nov 13, 9:44 am, "Altria" <urbante...@msn.com> wrote:
> Hello All,
> I would like to automate a daily report of accesschk againsts a file
> server
> but would like to include a datestamp, for example;
>
> accesschk -rws "group" "folder target" > %datestamp%.txt
>
> I would like afterwards to run a diff command (what is the equivalent of
> this in windows?) against the files and see if any access permissions have
> changed
>
> Any help would be greatly appreciated!
>
> Thanks,
> Altria
Try something like this to get a datestamp ...
for %%a in (%date%) do set datestamp=%%a
set datestamp=%datestamp:/=%
accesschk -rws "group" "folder target" > %datestamp%.txt
It creates a date stamp in a form of ddmmyyyy in the US or mm-dd-yyyy
elsewere. A more 'sortable' date stamp requires significantly more
code. Handling dates, in general, is locale dependent, which can
complicate explaining how to get one in batch. It's a bit easier in
WinScript, but that seems to be off topic.
The other question about comparing file contents can be done with the
FC (file compare) utility. For example (in XP), ...
fc file1.txt file2.txt > nul
if not errorlevel 1 (
echo Files are identical
) else (
echo Files are different
)
Tom Lavedas
***********
http://there.is.no.more/tglbatch/