0

我正在尝试设置一个 autorun.inf 文件和批处理文件,以检查是否安装了程序。如果没有,我想在插入 USB 驱动器时运行安装文件。这是我的代码:

setlocal
set VMP=C:\Program Files\VMware\VMware Player\
cd C:\Program Files\VMware\VMware Player\
if exist %VMP% (
start vmx
) else (
start VMware-player-2.5.2-156735.exe 
)

vmx 是 U 盘根目录中的快捷方式,它指向我要运行的 .vmx 文件。无论 %VMP% 是否存在,它都会同时打开两个文件。谁能帮我吗?

4

1 回答 1

1

把你的路径放在引号里。

setlocal
set VMP="C:\Program Files\VMware\VMware Player\"
cd "C:\Program Files\VMware\VMware Player\"
if exist %VMP% (
start vmx
) else (
start VMware-player-2.5.2-156735.exe 
)
于 2009-06-22T15:55:48.920 回答