我目前有以下Windows命令脚本。我想创建一个菜单,显示所有可用的事件类型,而不必手动输入。脚本的用户只需要输入一个数字。
@echo off
set /p customerID="Enter Customer ID: "
set /p event="Enter Event Name: "
setlocal enableextensions disabledelayedexpansion
set "sourceFolder=C:\test"
set "targetFolder=C:\test2"
set "customerID=%customerID%"
set "event=%event%"
for /f "delims=" %%a in ('
findstr /m /s /l /c:"%customerID%" "%sourceFolder%\*"
^| findstr /f:/ /m /l /c:"%event%"
') do (
copy "%%~fa" "%targetFolder%"
)
pause