How to install inf file from base directory from Batch File (.bat)?

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.


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.

Need Your Help

Error in Bioperl program execution

algorithm perl bioinformatics bioperl clustal

I have installed bioperl but confused where to get it and where to run the bioperl program.Then I have tested for it and it was successful

Spring AOP proxy use

java xml spring aop

I try introduced new method to class in spring framework using AOP proxy. But on the console i see class cast exeption.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.