Double file double loop
Posted: 23 Mar 2011 23:16
Hello everyone,
I have a group of files *.bat and *.txt that are required to run in pairs (1 bat, 1 txt). I've been trying to call the batch and execute the command for the txt file in the same loop but I am having some troubles figuring out how to use variables and loop everything out.
Here is an example of the files:
SE-POS-W05-20110323054226.bat
SE-POS-W05-20110323054226.txt
US-POS-F10-20110323054156.bat
US-POS-F10-20110323054156.txt
Please find here the code that I tried to put together:
If I was running the above from the command line for each pair, I first
run the bat file, then run the following command with the txt file "doupdate IMPORT_POS name of the txt file %POSCAL%"
Your advice will be greatly appreciated!!
I have a group of files *.bat and *.txt that are required to run in pairs (1 bat, 1 txt). I've been trying to call the batch and execute the command for the txt file in the same loop but I am having some troubles figuring out how to use variables and loop everything out.
Here is an example of the files:
SE-POS-W05-20110323054226.bat
SE-POS-W05-20110323054226.txt
US-POS-F10-20110323054156.bat
US-POS-F10-20110323054156.txt
Please find here the code that I tried to put together:
Code: Select all
FOR %%G IN (C:\alx\*.*) DO (
call *.bat %%G
doupdate IMPORT_POS %%G %POSCAL%
)
If I was running the above from the command line for each pair, I first
run the bat file, then run the following command with the txt file "doupdate IMPORT_POS name of the txt file %POSCAL%"
Your advice will be greatly appreciated!!