Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.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
Windows 系统在文本文件上找不到指定的文件错误_Windows_Batch File_Cmd - Fatal编程技术网

Windows 系统在文本文件上找不到指定的文件错误

Windows 系统在文本文件上找不到指定的文件错误,windows,batch-file,cmd,Windows,Batch File,Cmd,我有一个包含ff:代码的文件名.txt for /f "tokens=1" %%s in (C:\user\files\title.txt) do ( log normal "c:\user\user-log.txt" ) 现在我有了一个批处理文件,它调用names.txt。然而,它总是显示 The system cannot find the file specified. 如何解决此问题?是否可以在文本文件上使用批处理代码?如前所述,您希望读取一个文件并将读取的内容附加到另一个文件中。为

我有一个包含ff:代码的文件名.txt

for /f "tokens=1" %%s in (C:\user\files\title.txt) do (
log normal "c:\user\user-log.txt"
)
现在我有了一个批处理文件,它调用names.txt。然而,它总是显示

The system cannot find the file specified.

如何解决此问题?是否可以在文本文件上使用批处理代码?

如前所述,您希望读取一个文件并将读取的内容附加到另一个文件中。为此,您可以使用以下基于这些帖子的答案创建的脚本

您需要将上述代码放入批处理文件中,还需要根据您的要求替换文件到readfrom.txt和AppendToFile.txt的路径


如果这不是你想要的,请告诉我

您可以在txt中使用批处理代码,但不要期望在运行批处理文件时执行它。顺便问一下,当出现上述错误时,您是如何执行它的?还有,你想实现什么?@Shaikh Mohammed Shariq Im am使用一个批处理文件,该批处理文件调用存储name.txt位置的特定变量(set varBCscript=@C:\user\userfiles\name.txt)。你能发布调用上述变量的批处理文件的代码吗?另外,您能否再次检查文件路径是否正确,以及文件是否位于上述相同位置?@Shaikh Mohammed Shariq顺便问一下,我们是否有任何选项可以将文件内容传递到另一个文本文件中?例如,我有name.txt,其中一个值必须来自另一个文本文件。我只需要从另一个文本文件中获取第一行。是的,您可以读取文本文件数据,也可以通过批处理文件本身将其传递到另一个文件中。你能详细说明一下你到底想实现什么,以便我们朝着这个方向努力吗?OP很难理解,但据我所知,
键入file1.txt>>name.txt
。是的,这是我与@PeterS聊天时需要的。纯溶液。
@echo off
set "file=F:\FileToReadFrom.txt"
set /A i=0

for /F "usebackq delims=" %%a in ("%file%") do (
set /A i+=1

call set array[%%i%%]=%%a
call set n=%%i%%
)

for /L %%i in (1,1,%n%) do call echo %%array[%%i]%%>> F:\AppendToFile.txt