开发者

Unable to use a set variable in batch file

开发者 https://www.devze.com 2023-02-18 02:30 出处:网络
Hi I have this code in my batch file set destpath = \"C:\\\" copy 开发者_如何学Gohelp.txt %destpath%

Hi I have this code in my batch file

set destpath = "C:\"

copy 开发者_如何学Gohelp.txt %destpath%

pause

But I see that the command that gets executed while running the batch file is

copy help.txt

The batch file is not recognizing the 'destpath' variable at all. What could be the issue here?


You should have no space before the equal sign. Try

set destpath=c:\

instead.


don't use spaces: set destpath="C:\"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号