下面是批量获取指定目录下的文件名的核心代码

@echo off
echo text input

set input=
set /p input=:
echo %input% is input
cd %input%
rem @echo on
for %%a in (*) do (
  echo %%a is input
)

cd ..

如下是sql server执行对应脚本文件

sqlcmd -Spcserver -dmaster -Usa -PcrexPT84B -i 脚本文件