Batch file 将命令行命令转换为批处理文件时出错
当我跑步时:Batch file 将命令行命令转换为批处理文件时出错,batch-file,Batch File,当我跑步时: D:\practice\\build\armv7a\gcc\am335x\beaglebone\bootloader>make 在命令提示符下,它可以正常工作 现在,我想将同一命令转换为批处理文件。如下所示: @echo off echo comipling the files D:\practice\\build\armv7a\gcc\am335x\beaglebone\bootloader>make echo comipling done... pause
D:\practice\\build\armv7a\gcc\am335x\beaglebone\bootloader>make
在命令提示符下,它可以正常工作
现在,我想将同一命令转换为批处理文件。如下所示:
@echo off
echo comipling the files
D:\practice\\build\armv7a\gcc\am335x\beaglebone\bootloader>make
echo comipling done...
pause
已保存文件build.batch
但当我点击此按钮时,会出现错误:
**comipling the files
'D:\practice\\build\armv7a\gcc\am335x\beaglebone\bootloader' is not recognized as an internal or external command,
operable program or batch file.
comipling done...
Press any key to continue . . .**
**合并文件
“D:\practice\\build\armv7a\gcc\am335x\beaglebone\bootloader”未被识别为内部或外部命令,
可操作的程序或批处理文件。
完成了。。。
按任意键继续**
为什么
您的命令提示符显示您的工作位置、当前的active directory是什么,并且不应作为命令的一部分包含在批处理文件中
与命令行等效的方法应该是首先将当前active directory更改为指定的文件夹,然后执行该命令
@echo关闭
echo对文件进行复制
Rem更改为指定的文件夹
cd/d“d:\practice\build\armv7a\gcc\am335x\beaglebone\bootloader”
现在,执行命令
制作
echo编译完成。。。
暂停
v..v This is the program to execute
D:\practice\b ... ne\bootloader> make
^..............................^
This is the command prompt