提示用户输入将用于创建目录的数据

时间:2019-01-13 20:59:01

标签: directory prompt

我创建了下面的批处理文件,这些文件已经拼凑在一起并且接近工作状态,但是我需要最后一部分的帮助。

批处理文件的目的是创建2个特定目录,这些目录将位于一个驱动器号上,该目录将根据用户系统以及当他们插入micro sd读卡器并由系统分配驱动器号时创建的驱动器而变化。

到目前为止,我已经提示用户输入驱动器号。 接下来,我需要让用户输入他们的电话号码,以便该号码可以附加到将被命名为“如果找到,请联系”然后输入他们的电话号码”的根目录中。

然后,在输入“ FAA注册号”的提示后,我需要创建另一个根目录。然后,无论他们为他们的FAA注册号输入了什么,此名称都将附加到名为FAA注册号的目录中。

这是我到目前为止所拥有的

@ echo off
:SetDriveLetter
set /p "drive=Enter Drive Letter of Mavic's Micro SD Card:"
:: check for colon following drive letter, add it if it's not there
:: (add whatever other input validation you think necessary)
if not "%drive:~1%"==":" set drive=%drive%:
if not exist "%drive%\" (
    echo invalid drive. 
    goto SetDriveLetter

:SetDirectory
set /p "dir=Press Enter"
:: check for backslash preceding the directory, remove it if it's there
:: (add whatever other input validation you think necessary)
if ^%dir:~0,1%==^\ set dir=%dir:~1%
echo This will create folders in %drive%\%dir%\  
choice /m "Continue with this operation?"
if errorlevel 2 (
    echo Operation cancelled by user.




md If Found Please Call 
//prompt user to enter phone number and have it added to the end of the directory 

created above

md FAA Registration Number
//prompt user to enter FAA Registration Number and have it added to the end of the 

directory created above

//If the directories already exist echo this to screen and ask if one wants to quit


    goto End






:End

0 个答案:

没有答案