0

我有一个简单的脚本来更改文件名并打开一个有关所述文件的 Excel 宏以对其进行操作。当我运行它时,文件会在标题为“FM-001761-01 Substrate Thickness.xls”的命令提示符中打开,而不是实际文件。代码如下:

if exist "FM-001761-01 Substrate Thickness.xls" (
    msg "%username%" Please move the current FM-001761-01 Substrate Thickness.xls file
    quit
)
if exist qcprint.txt (
    if exist qcprint.csv (
        del qcprint.csv
        rename "qcprint.txt" qcprint.csv
        start "FM-001761-01 Substrate Thickness backup.xlsm"
    ) else (
        rename "qcprint.txt" qcprint.csv
        start "FM-001761-01 Substrate Thickness backup.xlsm"
    )
) else (
    if exist qcprint.csv (
        start "FM-001761-01 Substrate Thickness backup.xlsm"
    ) else (
        msg "%username%" Please load the "qcprint.txt" file to the flash drive.
    )
)

在此处输入图像描述

4

1 回答 1

2

start命令的语法(已删减,start /?完整语法见 )是:

start ["title"] [command/program] [parameters]

如果您[command/program]在引号中,start则认为它是标题,并且由于它没有看到任何程序,因此只需启动一个命令窗口。

解决方案:

start "" "FM-001761-01 Substrate Thickness backup.xlsm"
于 2013-06-10T19:33:53.033 回答