Ask: How to judge that the input variable is empty.
Purpose:
According to the content in set.ini such as E:\aaa1\bbb2.gho, that is, including drive letter, directory, file name, where the directory can be absent.
By separating the characters in set.ini, respectively obtain the variables of drive letter, directory, file name.
If there is no drive letter or no file name, it needs to be reset, otherwise continue.
The following is my code, please ask where is wrong? Thank you.
------------------
:sub_18d
Rem Read the settings file Set.ini
For /f "tokens=*" %%i In (c:\_set.ini) Do (
Set drive=%%~di
Set directory=%%~pi
Set filename=%%~nxi
)
If %drive%=="" Goto sub_18h
If %filename%=="" Goto sub_18h
Goto sub_18e
:sub_18h
cls
Echo.
Echo The custom path format is incorrect, and it needs to be reset [correct format such as E:\aaa1\bbb2.gho].
Echo.
pause
Goto Set
:sub_18e
Purpose:
According to the content in set.ini such as E:\aaa1\bbb2.gho, that is, including drive letter, directory, file name, where the directory can be absent.
By separating the characters in set.ini, respectively obtain the variables of drive letter, directory, file name.
If there is no drive letter or no file name, it needs to be reset, otherwise continue.
The following is my code, please ask where is wrong? Thank you.
------------------
:sub_18d
Rem Read the settings file Set.ini
For /f "tokens=*" %%i In (c:\_set.ini) Do (
Set drive=%%~di
Set directory=%%~pi
Set filename=%%~nxi
)
If %drive%=="" Goto sub_18h
If %filename%=="" Goto sub_18h
Goto sub_18e
:sub_18h
cls
Echo.
Echo The custom path format is incorrect, and it needs to be reset [correct format such as E:\aaa1\bbb2.gho].
Echo.
pause
Goto Set
:sub_18e
Windows 一键还原
http://www.yjhy.com
http://www.yjhy.com
