Making a batch file run faster
Posted: 19 Jan 2019 22:31
Hi guys,
I have a batch file that basically does the following each time:
-> Types the content of file1 into a text file (say fileA)
-> Then using the content of file1 performs a scan of a folder containing 900 files using an application called clamscan
-> Finally it saves the result into the same text file (i.e. fileA)
I have around 400k plus files to process and the steps above remain the same for every file. Right now it aprrox. takes 1.2 to 1.8 seconds to process each file. It is actually searching for a string one by one in the 900 files using clamscan and saves the results into a text file. I execute the batch file inside the folder containing that 900 files.
Part of my code is as follows:
Thanks in advance
plasma33
I have a batch file that basically does the following each time:
-> Types the content of file1 into a text file (say fileA)
-> Then using the content of file1 performs a scan of a folder containing 900 files using an application called clamscan
-> Finally it saves the result into the same text file (i.e. fileA)
I have around 400k plus files to process and the steps above remain the same for every file. Right now it aprrox. takes 1.2 to 1.8 seconds to process each file. It is actually searching for a string one by one in the 900 files using clamscan and saves the results into a text file. I execute the batch file inside the folder containing that 900 files.
Part of my code is as follows:
Code: Select all
@echo off
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100001.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100001.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100002.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100002.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100003.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100003.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100004.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100004.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100005.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100005.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100006.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100006.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100007.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100007.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100008.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100008.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100009.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100009.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100010.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100010.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100011.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100011.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
TYPE "C:\Users\nv\Desktop\Individual_sigs19\Sig100012.ndb" >> "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt" & "C:\Users\nv\Desktop\Clam\clamscan.exe" -d "C:\Users\nv\Desktop\Individual_sigs19\Sig100012.ndb" -l "C:\Users\nv\Desktop\Sig_Log_test_18_2.txt"
plasma33