• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part III: Appendixes > Environment Variable Expansion

Environment Variable Expansion

The expressions listed in Table D.3 expand into environment variable values. In the expressions, name is the name of an environment variable.

Table D.3. Environment Variable Replacement and Editing
Expression Result
%name% Value of environment variable name.
%name:~n% Skips the first n letters and returns the rest.
%name:~n,m% Skips the first n letters and returns the next m.
%name:~,m% First (leftmost) m letters.
%name:~-m% Last (rightmost) m letters.
%name:str1=str2% Replaces every occurrence of str1 with str2. Str2 can be blank to delete all occurrences of str1. Str1 can start with * to match any string characters ending with str1.
!name! When Delayed Expansion is enabled with /v:on or setlocal ENABLEDELAYEDEXPANSION, this expression is replaced with the value of variable name just before the command is executed.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint