我有一个 .bat 文件,允许用户输入完整的文件名(完整路径),我想知道是否可以验证用户是否输入了例如 .bak 文件?
问问题
4877 次
1 回答
3
例子:
set /p "FullPathNameData=Please enter the full path name of backup file for YourBackup: "
for /f "delims=" %%a in ("%FullPathNameData%") do set "Extension=%%~xa"
if /i "%Extension%"==".bak" (echo %FullPathNameData% is a BAK file) else %FullPathNameData% is NOT a BAK file
于 2013-09-24T12:35:58.327 回答