Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.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
Batch file 无法在批处理文件中使用集合变量_Batch File - Fatal编程技术网

Batch file 无法在批处理文件中使用集合变量

Batch file 无法在批处理文件中使用集合变量,batch-file,Batch File,嗨 我的批处理文件中有此代码 set destpath = "C:\" copy help.txt %destpath% pause 但是我看到在运行批处理文件时执行的命令是 copy help.txt 批处理文件根本无法识别“destpath”变量。这里可能有什么问题?在等号之前应该没有空格。 试一试 相反。等号前不应留空格。 试一试 相反。不要使用空格:set destpath=“C:\”不要使用空格:set destpath=“C:\” set destpath=c:\

嗨 我的批处理文件中有此代码

set destpath = "C:\"

copy help.txt %destpath%

pause
但是我看到在运行批处理文件时执行的命令是

copy help.txt

批处理文件根本无法识别“destpath”变量。这里可能有什么问题?

在等号之前应该没有空格。 试一试


相反。

等号前不应留空格。 试一试


相反。

不要使用空格:
set destpath=“C:\”
不要使用空格:
set destpath=“C:\”

set destpath=c:\