BATCH脚本 - 将某些内容传输到非现有文件夹中的文件中

时间:2014-08-19 09:02:34

标签: batch-file pipe

是否有可能在不存在的文件夹中管道内容,例如

"bla bla" > .\nonexisitngFolder\bla.txt

上面给出了这个错误:

The system cannot find the path specified.

或者只是像

那样工作
mkdir .\nonexisitngFolder
"bla bla" > .\nonexisitngFolder\bla.txt

2 个答案:

答案 0 :(得分:0)

我很确定如果您要向其输出文件,该目录必须存在。 你能否提供更多关于你想做什么的背景知识?

答案 1 :(得分:0)

我是用Mofi的解决方案做到的。

if not exist nonexistingFolder mkdir nonexistingFolder
"bla bla" > .\nonexistingFolder\bla.txt