You are not logged in.

#1 19 Aug 2015 21:15

paul0041
Member
Registered: 19 Mar 2015
Posts: 21

tokens?

Hello, I am trying to get :ErrorAssociation to echo each token in the variable %VerifyALL%, but of course %%i only contains the first token.  Is there a way that each time the for loop iterates, it can put the next token in the parameter %%i so that calling the :ErrorAssociation subroutine is simple?

:Verification
echo verifying all

Set VerifyALL=WriteuserAccount,RenameComputer,WriteDefaultPrinter,WakeTask-1031pm,PowerConfig-Staff,InstallAnti-Virus_Ent_64-bit,Win7licenseactivation,Office2013KMSactivation,faronicsavlic,UnReReg_authenticated,AVECLIupdatedefs,AVECLIFixNowQuick,SetDefaultPrinter

For /F "tokens=1-13 delims=," %%i IN ( "%VerifyALL%" ) Do Call :ErrorAssociation %%i
exit /b


:ErrorAssociation
echo %1
exit /b

Thanks ahead for any ideas / help!

Offline

#2 19 Aug 2015 21:52

Aacini
Member
Registered: 05 Dec 2012
Posts: 149

Re: tokens?

If each token in the variable does NOT contain spaces, semicolons or equal signs (that is the case of your example), a plain FOR do the work:

For %%i IN ( %VerifyALL% ) Do Call :ErrorAssociation %%i

Antonio

Offline

#3 19 Aug 2015 21:55

paul0041
Member
Registered: 19 Mar 2015
Posts: 21

Re: tokens?

I knew I was missing something simple...  Thank you Antonio!!!

Offline

Board footer

Powered by