We want to create a batch script that runs a command for each of our .xml files. The command should run for every file that does NOT end with _m. We try to go through each file with forfiles, but we dont know how to use do togheter with it.
This is our current not working script, where we try to go through every file. Identify the filename, and substring it to not run the command if it ends with _m.
forfiles /p /source /m *.xml do (
set "filename=@fname"
set "extension=_m.xml"
set "extended=%filename%extension"
IF NOT %filename:~-2%=="_m"(
ssoadm import-entity --cot something--realm something--spec saml2 -m @file -x %extended --adminid something--password-file password --debug
)
Thanks for any help!
forcommand instead of the externalforfilescommand, then you'll be able to usedo.