This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@setlocal EnableDelayedExpansion | |
@echo off | |
set "SourceDir=." | |
REM count the number of files | |
pushd "!SourceDir!" | |
set /a FileCount=0 | |
for /f "usebackq delims=|" %%I in (`dir /a-d-s-h /b *.url`) do set /a FileCount+=1 | |
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>template.bat /? | |
test v1.23 | |
This is a sample batch file template, | |
providing command-line arguments and flags. | |
USAGE: | |
test.bat [flags] "required argument" "optional argument" | |
/?, --help shows this help | |
/v, --version shows the version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@setlocal EnableDelayedExpansion | |
@echo off | |
set "SourceDir=." | |
REM count the number of files | |
pushd "!SourceDir!" | |
set /a FileCount=0 | |
for /f "usebackq delims=|" %%I in (`dir /a-d-s-h /b *.url`) do set /a FileCount+=1 | |
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
dir "%temp%" >NUL | |
echo err %errorlevel% | |
dir "c:\doesnotexist" >NUL 2>&1 | |
echo err %errorlevel% | |
dir "%temp%" >NUL | |
echo err %errorlevel% |