【发布时间】:2016-04-25 01:15:51
【问题描述】:
我正在尝试通过 Inno Setup 使用批处理脚本来复制一个 Windows .dll 文件。
显然,即使C:\Windows\System32 中没有msvcr120.dll 文件(我可以确认)我也只能看到“文件存在”。
当然,我也试过把下面的双引号去掉。
if exist "C:\Windows\System32\msvcr120.dll" (
rem file exists
echo "file exists"
pause
) else (
rem file doesn't exist
copy %1\Utilities\msvcr120.dll C:\Windows\System32\msvcr120.dll
echo "file doesn't exist"
pause
)
我手动检查过
C:\Users\changwon>dir /A:HS C:\Windows\System32\msvcr120.dll
Volume in drive C has no label.
Volume Serial Number is 4A80-BDED
Directory of C:\Windows\System32
File Not Found
你能告诉我有什么问题吗?
如何在 Inno Setup 中运行批处理
[Run]
Filename: "{app}\bin\Icacls\cacls.bat"; Parameters: """{app}"""
Filename: "{app}\Install\psql_init.bat"; Parameters: """{app}"""
其他结果
C:\Users\changwon>dir /A:L C:\Windows\System32\msvcr120.dll
Directory of C:\Windows\System32
File Not Found
C:\Users\changwon>where msvcr120.dll
INFO: Could not find files for the given pattern(s).
更新
Windows 7 64bit 并且在 C:\Windows\SysWOW64 中有一个 msvcr120.dll。 但我正在尝试将文件从我的源目录复制到 C:\Windows\System32。
【问题讨论】:
-
也许
msvcr120.dll被隐藏了?试试dir /A:HS C:\Windows\System32\msvcr120.dll;或者有一个具有该名称的目录 - 将/A:HS替换为/A:D以进行测试... -
更新问题。我没有看到文件。实际上,有这个文件,但为了我的测试,我将原来的 msvcr120.dll 重命名为 msvcr120_backup.dll。我的目的是在文件不存在时复制它。
-
也许也可以试试
dir /A:L C:\Windows\System32\msvcr120.dll或dir /S C:\Windows\msvcr120.*;或输入where msvcr120.dll... -
好的,所以问题正如我在回答中所描述的那样。你试过
64bit标志吗? -
等等,天才。我正在根据您的建议进行测试...
标签: batch-file inno-setup