Here is my another challenge. When I pass the file name into for loop, I want to get a specific word from the file name and need to pass that as a parameter as well.
For eg: When there are 5 files in a folder say
Encrypted_abc_1.xml Encrypted_xyz_2.xml Encrypted_hij_3.xml Encrypted_klm_4.xml Encrypted_nop_5.xml
I want to pass the file name Encrypted_abc_1.xml and abc into the for loop. I got the answer for both in seperate for loops however how can i merge into one single for loop
First for loop will fetch the word
for /f "tokens=2 delims=_." %%a in (Encrypted_*.xml /b) do (
Echo %%a
Another for loop will get the full file name
for /R "%Path%" %%f in (Encrypted_*.xml) do (
Echo %%f