|
| |||||||||
| Tags: batch script, check files |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
|
Hey Guys, I would like to know that which is the best Batch script for checking files. I would like to have a batch script for the following. 1) If say there is a folder A, in which there are 10 files which are updated daily. I would like to check this files and if the files are updated with latest timestamp. 2) If any of the file is been not updated, then it should be show a display error, saying this file is not been updated. 3) And on destination, before copying i need to have archive existing files. Is it possible for me to do so? Can any body provide me the correct logical steps for doing it? Any kind of information on the above issue would be appreciated. Thanks. |
|
#2
| ||||
| ||||
| Re: Need a Batch script to check files
OK file exists bit is easy: Quote:
|
|
#3
| |||
| |||
| Re: Need a Batch script to check files
You did not mention which timestamp - last modification time, last acces time or last creation time. I will assume last modification time. Here is the script. It is written in biterscripting. It will copy files modified after a certain time stamp from folder A to B. Quote:
Copy the above script into file C:/X.txt. Start biterscripting and call the script as follows. Quote:
|
|
#4
| ||||
| ||||
| Re: Need a Batch script to check files
OK, this is slightly more difficult. Variables are passed into a batch file as command line parameters. An example of this would be the following: Quote:
copier testfile.txt c:\folder This would, in the same way as copy does, copy the file from c:\ to c:\folder\ by calling copy to do it. Not very helpful yet, but you can use this a bit better with a nested batch file. File 1: test1.bat Quote:
Quote:
If you know BASIC, it equates to the CALL command is being a GOSUB with the end of the next file being a RETURN, whereas just the filename is a GOTO. Hope so it may help you out. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Need a Batch script to check files" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Batch Script to Convert PNG to XPM | BRIGHID | Operating Systems | 3 | 22-08-2010 04:25 AM |
| Batch file to check directory | Trini Alvarado | Software Development | 5 | 01-04-2010 12:00 PM |
| SharePoint Batch Check | RICO12 | Windows Software | 4 | 06-01-2010 02:59 AM |
| Need a batch script to map drive | Common | Networking & Security | 3 | 06-07-2009 08:42 PM |
| Batch script to move users to different OUs | Serrix | Active Directory | 6 | 23-12-2008 06:45 PM |