Hi All
The following code I got from Genius when I asked question its working fine get ,stores list of files from folders in a variable but now there is another requirement. I am not familiar with Batch files.
set myDir1=C:\test1
set myDir2=c:\test2
set classpath=
for /f "delims=" %%a in ('dir %myDir1% /b /a-d') do call :process1 %%a
goto :next
:process1
pause
if "%classpath%"=="" set classpath=%mydir1%\%1& goto :end
set classpath=%classpath%;%mydir1%\%1
goto :end
:next
for /f "delims=" %%a in ('dir %myDir2% /b /a-d') do call :process2 %%a
goto :end
:process2
set classpath=%classpath%;%mydir2%\%1
goto :end
:end
for loop is executing below the statements every time, what I need is it should not execute statements
-----------------------------------------------------------------------------------------------------------------------------
every time. I need loop should store list of files from folders in a variable, once list of files stored in
----------------------------------------------------------------------------------------------------------------------------
variable then it should execute following statements.
-----------------------------------------------------------------
SET COMMAND=java -D%PROPERTIESS% -cp %CLASSPATH% %CLASS% %ARGUMENTS%
%COMMAND%
Thanks in advance and thank for previous answers .