问题描述
我需要从批处理文件中调用C:\ Program Files目录中的exe文件.如何在批处理文件中提及目录名"Program Files".我遇到了类似C:\ Program的错误./p>
我认为必须在两者之间添加%或〜,但无法获得它.请提供帮助.
谢谢
使用""
包围脚本调用,通常使用文件路径是一种很好的做法.
"C:\Program Files"
尽管对于这个特定名称,您可能应该使用如下环境变量:
"%ProgramFiles%\batch.cmd"
或在64位窗口上使用32位程序:
"%ProgramFiles(x86)%\batch.cmd"
I need to invoke an exe file in C:\Program Files directory from a batch file.How can we mention the directory name "Program Files" in batch file.I am getting error like C:\Program not found.
I believe that % or ~ needs to be added in between but couldn't get it.Kindly assist.
Thanks
Surround the script call with ""
, generally it's good practices to do so with filepath.
"C:\Program Files"
Although for this particular name you probably should use environment variable like this :
"%ProgramFiles%\batch.cmd"
or for 32 bits program on 64 bit windows :
"%ProgramFiles(x86)%\batch.cmd"
这篇关于如何在batchfile中提及C:\ Program Files的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!