"Petr Laznovsky" <
[email protected]> said this in news item
In addition to Pegasus' comments:
*) In the case below it stops echo from generating an error message if a
variable is empty.
This will generate an error if %file% is empty/blank.
echo %file%
but this will echo a blank line
echo.%file%
and in another case: this will echo the word On
echo.On
whereas this line will be interpreted as the keyword ECHO ON
echo On
In all the cases above the dot can be replaced with many characters such as
/ and \ and others.
In the past someone tested a whole slew of them and I think the / character
was found to be the most compatible, but none of them are trouble free in
all cases.
*) Another use for a period is as a representation of the current directory
This line will execute notepad ONLY if the executeable is in the current
directory. Linux uses this syntax extensively.
..\notepad.exe
*) You may see two periods in a cd command such as
CD ..
and in that case it represents the parent folder and it will change the
directory to the folder that is next higher up in the directory tree.
EG: if you are in c:\windows\system32 then it will leave you in c:\windows
*) Yet another use for a period is as a wildcard in a regular expression
such as you might find with findstr.exe
In these three commands the . means "any character" so it will match moat
and gone but will not match dune because the second character is not an "o"
echo moat|findstr /r ".o.."
echo gone|findstr /r ".o.."
echo dune|findstr /r ".o.."
Hope that helps. Feel free to pose any other questions you have.