Batch file 如何使用批处理文件在文件夹中运行exe文件

Batch file 如何使用批处理文件在文件夹中运行exe文件,batch-file,Batch File,我有一个文件夹位置,如 C:\Users\Pathfinder\contribution\test 它由postgresql-9.0.13-1-windows.exe文件组成 我有一个批处理文件test.bat,我想用脚本运行它 我是批处理脚本的新手,所以我尝试的是:- CD \Users\Pathfinder\contribute\test postgresql-9.0.13-1-windows.exe postgresql-9.0.13-1-windows.exe --mode unatte

我有一个文件夹位置,如

C:\Users\Pathfinder\contribution\test

它由
postgresql-9.0.13-1-windows.exe
文件组成

我有一个批处理文件test.bat,我想用脚本运行它

我是批处理脚本的新手,所以我尝试的是:-

CD \Users\Pathfinder\contribute\test
postgresql-9.0.13-1-windows.exe postgresql-9.0.13-1-windows.exe --mode unattended
但它不起作用

我试过这样吗

CD \Users\Pathfinder\contribute\test
run postgresql-9.0.13-1-windows.exe postgresql-9.0.13-1-windows.exe --mode unattended


为什么不直接尝试C:\path to Users\Users\Pathfinder\contribution\test\postgresql-9.0.13-1-windows.exe


当然,如果驱动器号不同,请将C:替换为驱动器号

正确引用您的路径

"C:\Users\Pathfinder\contribute\test\postgresql-9.0.13-1-windows.exe" --mode unattended

因此,系统会了解到可执行文件的路径以及参数。

谢谢回答。我尝试了你的建议,但出现错误“系统找不到指定的路径”。是的,对不起,这是因为编辑器删除了我键入的部分内容:Try:C:\your Users文件夹的路径\Users\Pathfinder\contribution\test\postgresql-9.0.13-1-windows.exeya你是对的,但我的问题是。。。我必须以无人值守模式运行这个exe文件,即postgresql-9.0.13-1-windows.exe--无人值守模式我必须运行整个程序。thanx cristi。。。我得到了答案。我只需要附加它:)thanx如果文件夹名是“Demo start”怎么办?C:\Users\Demo start\contribute\test我是否必须给出像C:\Users\Demo start'\contribute\test这样的路径?您可以将所有路径保留在引号内:
“C:\Users\Demo start\contribute\test\…”
AFAIK,引号用于处理文件系统名称中的空格。
"C:\Users\Pathfinder\contribute\test\postgresql-9.0.13-1-windows.exe" --mode unattended