|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
!Around Variable Name!What does "!" around a variable name, as in
if !LINECNT!==TEST mean? Thanks, Alan "Alan" <jalantho***@verizon.net> wrote in message Try these batch files:news:5aa34481-a361-4796-8a1e-0dd24593907d@13g2000yql.googlegroups.com... > What does "!" around a variable name, as in > > if !LINECNT!==TEST > > mean? > > Thanks, Alan @echo off set Number= for /L %%a in (1,1,10) do ( set Number=%%a echo Number=%Number% ) @echo off SetLocal EnableDelayedExpansion set Number= for /L %%a in (1,1,10) do ( set Number=%%a echo Number=!Number! ) See the difference? "Alan" <jalantho***@verizon.net> wrote in message In this batch filenews:2557b37a-4355-4ffc-a72e-99510ab6069b@w34g2000yqm.googlegroups.com... >> See the difference? > > Yes. But why? > @echo off set Number= for /L %%a in (1,1,10) do ( set Number=%%a echo Number=%Number% ) the following lines of code for /L %%a in (1,1,10) do ( set Number=%%a echo Number=%Number% ) are treated as one single line of code. The command processor reads this "single" line, then resolves its variables. Since the variable "%Number% is set to "nothing" at the beginning, it remains at "nothing". To force a rescan, you must do two things: - You must enable "delayed expansion" - You must replace the %Number% with !Number!.
Access protected folders using system account
If syntax for numeric values SBS 2003 VB Scripting - Help Needed! modify incremental_backup Script to set share permissions on home directories Change Password LDAP query fails... because of parentheses? Script for Thunderbird configuration Undefined variable in login script Script to find the presence of a software |
|||||||||||||||||||||||