【发布时间】:2023-03-06 05:41:01
【问题描述】:
我有一个批处理文件,它运行并调用名为“SelectNBType.vbs”的 .vbs 文件 提到的 .vbs 文件提示一个小的 UI 输出,供用户输入字符串,如图所示。
///Start of Batch file///
For /F "Tokens=2 Delims=" %%I In ('cscript //nologo SelectNBType.vbs') Do
Set _NBType=%%I
IF %_NBType%==n (
Echo Normal
)
IF %_NBType%=="c" (
Echo Common
)
还有如下的.VBS
////Start of .VBS file
titletext = "Select Notebook Type"
prompttext = "Enter NB Type"
NBType = inputbox(prompttext & chr(13) & " (Type n if NORMAL user NB)" &
chr(13) & " (Type n if COMMON/POOL user NB)", titletext)
if NBType = "n" Then
x=MsgBox ("You have selected a Normal Notebook",0+32,"Notification")
WScript.Quit 1
elseif NBType = "c" Then
x=MsgBox ("You have selected a Common/Pool Notebook",0+32,"Notification")
End If
我正在尝试找出一种方法来允许 .vbs 文件将用户输入的输出作为字符串返回到批处理文件,以便以后可以使用它 if条件中的批处理文件如图所示。
谢谢
【问题讨论】:
标签: windows batch-file cmd vbscript echo