I need some kind of batch script which I can run everyday to check what kind of new files we have in network folders. I should be able to see *.xml files only from today and yesterday.
Sib,
Gpl is correct. We need the
date format for files on your machine.
cd to the directory you are working with.
C:\>cd c:\test\
c:\test>
Do a dir /OD *.xml and | pipe to more. Copy and paste part of that page here.
For example:
C:\test>dir /OD *.bat | more
Volume in drive C has no label.
Volume Serial Number is 0652-E41D
Directory of C:\test
04/24/2010 02:39 PM 1,018 x.bat
04/24/2010 02:39 PM 1,018 buildlog.bat
04/24/2010 06:37 PM 199 matt.bat
04/25/2010 11:27 AM 260 matt5.bat
04/25/2010 11:27 AM 260 matt2.bat
04/25/2010 11:34 AM 307 matt3.bat
04/25/2010 11:41 AM 224 matt4.bat
04/25/2010 02:17 PM 125 ver61.bat
04/25/2010 02:33 PM 190 ver612.bat
04/25/2010 05:14 PM 235 helpme.bat
04/27/2010 12:06 PM 32 chtoE.bat
04/27/2010 07:33 PM 89 fil.bat
04/27/2010 09:52 PM 631 cmpfil.bat
04/27/2010 10:18 PM 698 cmplist.bat
05/05/2010 04:52 PM 192 filefromstr.bat
05/06/2010 12:37 PM 199 hannes.bat
05/06/2010 01:06 PM 194 erasedir.bat
05/07/2010 10:57 AM 229 sw57.bat
05/07/2010 02:16 PM 85 sw58.bat
-- More --
also do an
echo %DATE%c:\test>echo %DATE%
Thu 06/10/2010c:\test>
Create a test directory and copy about 30 of the files you are concerned with.
Don't run the code on the large folders until the code is working correctly.( Forget the vbs code for finding yesterday's date. Enter yesterday's date manually until everything else works. We can find an easier way to find yesterday's date later. ( Or Salmon Trout might show you how to set up the vbs code later. ))
Good Luck