Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 40,621 of 42,547    |
|    foxidrive to ehabaziz2001@gmail.com    |
|    Re: setting variable inside for loop    |
|    13 Apr 13 03:06:16    |
      XPost: alt.msdos.batch.nt       From: not@this.address.invalid              On 13/04/2013 2:45 AM, ehabaziz2001@gmail.com wrote:       > FOR /F "tokens=*" %%G IN (dir.lst) DO (       > @echo %%G       > @set filename2=%%G       > @echo %filename2%       > )       >       >       > How can I set my filename2 because I can not find it filled with %%G content       .              Try this, or use delayed expansion and !filename2!              FOR /F "tokens=*" %%G IN (dir.lst) DO (       @echo %%G       @set filename2=%%G       )       @echo %filename2%                            Followup set to alt.msdos.batch.nt                     --       foxi              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca