Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 批处理:设置批处理创建的文件的路径_File_Batch File_Random_Cmd - Fatal编程技术网

File 批处理:设置批处理创建的文件的路径

File 批处理:设置批处理创建的文件的路径,file,batch-file,random,cmd,File,Batch File,Random,Cmd,我正在尝试创建一个小程序,它将在c-drive上创建一个.txt文件。它应该向其中添加%random%的文本,但是如何设置路径 type %random% > c:\create.txt ->这会将%random%的内容添加到文本文件create.txt中。 ->如果您已经知道%random%的路径,可以将其设置为环境变量。 ->否则,可以使用echo命令。echo%random%>c:\path\file.txt?

我正在尝试创建一个小程序,它将在c-drive上创建一个.txt文件。它应该向其中添加%random%的文本,但是如何设置路径

type %random% > c:\create.txt
->这会将%random%的内容添加到文本文件create.txt中。
->如果您已经知道%random%的路径,可以将其设置为环境变量。

->否则,可以使用echo命令。

echo%random%>c:\path\file.txt