Searching for files and sending mail

Hi,

I want a script that can perform the following tasks,

1)Open command prompt and navigate to certain path (for eg: C:\Programs\) and then execute the below command on a daily basis,

list -C <client name> -t 13 -l -R -s <previous_day> /D > D:\Prgrams\list_currentdate.txt

Note: There are 4 clients and the above command should be executed four times one time for each client , and the previous date should be calculated through some mean and passed on to that field (after -s in the command). The output is redirected to a folder with name list_currentdate.txt. And please note that only the underlined fields should only be changed and the rest of the fielss are constant in the command.

2) Mail the file to mail id. Please help me out.

Not sure you are in the right forum, I will leave it here for a little while to see if it inspire anybody though

just for the sake of getting previous date in MS-DOS , you can use Powershell provided by MS.
this command will give you Yesterday's date using PowerShell,

powershell -C $dte = Get-Date; echo $dte.AddDays(-1)

Else if you intend to use the pure native DOS capacities to generate a date (N-1) for you, you maay take a look at some of the google results which are again very different in execution and may take longer than required or may produce results differently.

For sending email from cmd line, try to use a configured MS-Outlook and then issue command line switches for sending email.

combining all these substitutes in in one single interpreter's file and then expecting it to return desired result will require a lot more troubleshooting .

VBS could do the same in more easy and generic way.

Regards,