|
| |||||||||
| Tags: batch script, check files |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| 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 | smiles | Windows Server Help | 0 | 2 Weeks Ago 12:34 AM |
| SharePoint Batch Check | RICO12 | Windows Software | 4 | 06-01-2010 01:59 AM |
| Need a batch script to map drive | Common | Networking & Security | 3 | 06-07-2009 07:42 PM |
| Can We check the exit command in the batch file | Dhruv | Software Development | 3 | 30-12-2008 10:56 PM |
| How can I play a Wav file from batch/cmd script? | hbfavor | Windows Vista Performance | 7 | 13-09-2008 09:21 PM |