是否有可能从一个批处理文件或CMD脚本添加一个目录来DLL搜索路径? [英] Is it possible to add a directory to DLL search path from a batch file or cmd script?
问题描述
MSDN说,功能 SetDllDirectory会()的可用于插入目录到 DLL搜索路径。可以将此功能从一个批处理文件或CMD脚本访问,可能通过 CSCRIPT 使用一>
MSDN says that the function SetDllDirectory() can be used to insert a directory into the DLL Search Path. Can this function be accessed from a batch file or cmd script, perhaps using via cscript?
这样做的目的是让我们的DLL开发版本之前发现了一个pre-现有的旧模块在%WINDIR%等,而无需编写一个程序只是为了这一点。
The aim is to have our development version of a dll found before a pre-existing older one in %WINDIR% etc. without having to write a program just for that.
在此先感谢您的时间和想法。
Thanks in advance for your time and thoughts.
推荐答案
您可以将DLL中的可执行文件,这是第一次搜索之前%WINDIR%相同的路径。有没有办法从一个批处理文件直接调用SetDllDirectory会。
You can place the DLL in the same path as the executable, which is searched first before %WINDIR%. There's no way to call SetDllDirectory from a batch file directly.
这篇关于是否有可能从一个批处理文件或CMD脚本添加一个目录来DLL搜索路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!