Select the product you need help with
Percent Signs Stripped from Batch File TextArticle ID: 75634 - View products that this article applies to. This article was previously published under Q75634 SUMMARY
Using a percent sign (%) in a batch file requires that two percent
signs (%%) be specified.
For example, the command to display "5%" from a batch file would be : ECHO 5%% MORE INFORMATION
MS-DOS uses %1, %2, ... %9 as replaceable command line parameters. For
example, before executing the command ECHO %1, %1 will be replaced
with the first parameter passed to the batch file. %0 is replaced with
the command used to execute the batch file.
A single percent sign on a line is treated as a "nul" character in a batch file. For example: ECHO % is processed as ECHO ECHO a%b is processed as ECHO ab COMSPEC=C:\COMMAND.COM PATH=C:\DOS PROMPT=$P$G B=C ECHO %PATH% is processed as ECHO C:\DOS ECHO a%b% is processed as ECHO aC ECHO a%b b%a is processed as ECHO aa FOR %V IN (*.COM) DO ECHO %V FOR %%V IN (*.COM) DO ECHO %%V "Microsoft MS-DOS Batch File Quick Reference," Microsoft Press. PropertiesArticle ID: 75634 - Last Review: May 10, 2003 - Revision: 2.0 APPLIES TO
| Article Translations |



Back to the top








