欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

bat 批量提取指定目录下的文件名

程序员文章站 2022-03-02 13:36:30
下面是批量获取指定目录下的文件名的核心代码 @echo off echo text input set input= set /p input=: echo %i...

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

@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 脚本文件

由上面两个命令就可以写出批量执行一个文件夹下面的所有脚本文件了。