为了删除不再使用的用户配置文件,AutoReport.bat用到了Delprof工具。这个工具在Microsoft Windows 2000 Server Resource Kit和Microsoft Windows NT Server 4.0 Resource Kit都有,但不同操作系统的工具不能混用。如果用了版本错误的Delprof,会出现错误信息“Entry point not found”。删除过期用户配置文件的命令为:
:: 放置工具软件的位置 SET SharedDir=\\ServerDir\tools :: 用来发送邮件的SMTP服务器 SET MailServer=smtp.MyServer.com :: 邮件的发件人 SET Sender=myName@MyServer.com :: 邮件的收件人清单,用逗号分隔多个地址 SET Recipients=FirstMan@MyServer.com,SecondMan@MyServer.com
:: 删除以前可能留存的Blat.txt文件(如因为脚本被中止运行) IF EXIST %systemdrive%\Blat.txt del %systemdrive%\Blat.txt IF EXIST %systemdrive%\Blat2.txt del %systemdrive%\Blat2.txt