[<<]Message[>>]    [<<]Author[>>]    [<<]Subject[>>]    [<<]Thread[>>]

Number : 2653 Date : 2002-08-14 Author : Kan Yabumoto Subject : Re: Can you use %username% in an exclude list? Size(KB) : 2
Let me clarify a subtle point in using the environment variable in XXCOPY's command line. When you use a reference to an environment variable in the command line, you should follow the "standard" syntax which is dictated by the command processor (COMMAND.COM or CMD.EXE) where you sandwich the name of the environment variable by %. E.g., xxcopy c:\backup\%username%\ d:\%username%\ /clone xxcopy c:\mydir\ d:\dest\ /x%username%\*.zip /clone In these examples, the environment variable, USERNAME is referenced by the %username% part in the command line. The substitution of the string %username% by its value is done by the command processor (not by XXCOPY). So, by the time XXCOPY is invoked, the command is already substituted by the value of the environment variable. Note that XXCOPY also supports the environment variable inside its command file (/CF) or exclusion file (/EX). Since these files are not processed by the command processor before xxcopy receives control, any use of environment variable such as %username% must be processed by XXCOPY itself. Because the delimiter character (%) used for the environment variable is a valid character for a filename, XXCOPY cannot use the same syntax rule for the environment variable reference as in the command line. Therefore, XXCOPY uses its own syntactic rule --- add a slash as the prefix for the reference to an environment variable. That is, Inside a /CF or /EX file, use /%username% which will be substituted by the value of the environment variable, USERNAME. Summarizing the macro/env-var substitution rules: /$xxxxxx$ // macro reference /%xxxxxx% // environment variable reference Note that the prefix (/) is always needed for the macro reference whereas the prefix (/) must not be used in the command line for environment variable (because the command processor will do it for XXCOPY before its invocation). Kan Yabumoto ========================================================= At 2002-08-13 22:30, you wrote: >The usage of %username%*.zip works from the command line, but I can't >get this work from within my exclude file. Have you tried this out >yourself Joseph?, as this doesn't work for me..
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.