red_ruewei 0 Light Poster

Hi all,
Sorry if I post duplicate thread. I'm using windows batch program and still very beginner.
I'm having a problem to read record from database. I'm planning to automated read folder name(folder name as reference number of project) from specific root folder and compare the folder name whether exist or not on table.

here is my batch program

@echo off
SET VAR=%1
cd temp
cd SDMS_SHAREDOC

FOR /D %%G IN ("%VAR%*") DO call :1 %%G
goto :eof

:1
cd C:\apachefriends\xampp\mysql\bin
mysql -h localhost -u root -D sdms_baru -e "SELECT count(NO_ADJUDIKASI) FROM daftar_kes WHERE NO_ADJUDIKASI = '%1' "
::got problem in here to display record
::planning to check if folder name is exist in table, nothing need to do while if folder name is exist this folder name will insert into table n the folder will be move into other folder


pause

hope anyone can help me. tq