Batch : Use the FOR command to check the files in the folder -


i have made ​​a batch script perform following tasks : if file abc.laccdb still in update folder , show message : wait minute.... if abc.laccdb file not in 'update' folder , show message : updating data successfully..

my batch script :

@echo off start update_data.vbs :check %%f in (update\abc.laccdb) ( echo wait minute... goto :check ) echo updating data pause 

with script above , message "wait minute ... " continuously displayed in command prompt window, though abc.laccdb file has not in update folder. if abc.laccdb file not there in update folder, bacth application run next line (echo updating data successfully). please correct script. thank :)

using mc nd's answer:

@echo off     echo wait minute...     start update_data.vbs     ping -n 5 localhost >nul 2>nul  :check     if exist "update\abc.laccdb" (         ping -n 3 localhost >nul 2>nul          goto :check     )     echo updating data     pause 

display echo wait minute... message in advance...


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -