相关疑难解决方法(0)

用于递归复制目录的批处理文件

有没有办法在.bat文件中递归复制目录?如果是这样,一个例子会很棒.谢谢.

copy batch-file

108
推荐指数
4
解决办法
20万
查看次数

如何递归执行Windows批处理命令?

例如,批处理文件中有重命名命令,并且您希望在当前目录和所有子目录上执行该文件.

windows shell command-line cmd batch-file

9
推荐指数
1
解决办法
9572
查看次数

在构建期间自动执行xsd.exe

我需要一种基于*.xsd文件在构建期间自动重新生成*.cs文件的方法,最好不涉及任何自定义加载项.这也需要在CI构建上运行.

我不确定我是否遗漏了一些明显的东西,或者这对我来说是否真的很棘手?

.net c# msbuild xsd visual-studio

5
推荐指数
1
解决办法
9060
查看次数

*.*在C中的argv [1]中

背景:某些Windows命令行程序允许*.*在第一个参数中使用:

myprogram *.*
Run Code Online (Sandbox Code Playgroud)

并将自动循环目录的所有文件.

其他一些则没有,因此需要批处理循环:

for %%c in ("*.*") do myprogram "%%c"
Run Code Online (Sandbox Code Playgroud)

问题:是否有标准方式(在C语言中定义或OS提供?)允许*.**.txt在参数中,以便它自动对相关文件进行处理?

int main(int argc, char *argv[])
{
    FILE *kf;

    "for fname in argv[1]"    // pseudo code here meaning: 
                              // let's loop on all files described by the first argument
    {
        kf = fopen(fname, "rb");
        ...
    }
}
Run Code Online (Sandbox Code Playgroud)

我想检查一个解决方案是否存在,然后滚动我自己(重新发明通配符扩展的轮子,使用FindFirstFile等)

c windows filesystems filenames wildcard

5
推荐指数
1
解决办法
214
查看次数

Windows批处理文件,通过子文件夹循环

我没有成功编写适当的批处理文件,将不胜感激。

假设我在D:\ Test \中有一个称为script.exe的exe。要执行此script.exe,它需要一个.bin文件的附加参数(例如bin01.bin,bin02.bin)。

因此,它将类似于:script.exe -i bin01.bin,script.exe -i bin01

我希望脚本与所有子文件夹中的所有.bin文件一起执行

D:\Test\script.exe
D:\Test\Folder01\bin01.bin
D:\Test\Folder01\bin02.bin
D:\Test\Folder02\bin01.bin
D:\Test\Folder03\bin01.bin

anyone could help me here? Thanks a lot in advance.

windows batch-file

1
推荐指数
1
解决办法
7164
查看次数

使用批处理文件将文件从内部目录递归复制到外部

有这个目录结构:

Dir1
--Dir2
    --File1
    --File2
--Dir3
    --File3
--File4
--File5
Run Code Online (Sandbox Code Playgroud)

现在我想使用批处理文件将子目录(Dir2,Dir3)中的所有文件复制到父目录Dir1.我已经提出了下面的代码,但它并不完美.我得到以下输出 -

Directory2             --It has 4 files all together
Invalid number of parameters
Invalid number of parameters
Does E:\Directory1\Copy\File1.dat specify a file name   -- And only this file gets copied
or directory name on the target
(F = file, D = directory)?
Run Code Online (Sandbox Code Playgroud)

代码 -

@echo off
call :treeProcess
Pause
goto :eof

:treeProcess
rem Do whatever you want here over the files of this subdir, for example:
for /D %%d in (*) …
Run Code Online (Sandbox Code Playgroud)

recursion xcopy batch-file

0
推荐指数
1
解决办法
6318
查看次数