Reputation: 1041
I want to make a Batch File (.bat
) to install an .inf
file that is located in the base directory of the .bat
file. I managed to install the .inf
, but only if I specify the full directory. How can I install the .inf
file without specifying the full directory?
Here's what I have so far:
%SystemRoot%\System32\InfDefaultInstall.exe "DroidInstaller.inf"
Any help would be greatly appreciated.
Upvotes: 1
Views: 8305
Reputation: 5599
Your question is quite vague. If both files (your installer.bat
and the inf
file) are in the same directory then you can add pushd "%~dp0"
at the start of your batch-script:
@echo off
pushd "%~dp0"
%SystemRoot%\System32\InfDefaultInstall.exe "DroidInstaller.inf"
This will set the working directory to the directory where your batch-script runs in. If this directory is the same as the directory of your inf
file then you are able to call the DroidInstaller.inf
the way you did in your question.
Upvotes: 3