Solved

Installation of INF-file via batch script is not going as expected

Posted on 2010-11-15
10
1,059 Views
Last Modified: 2012-05-10
I'm trying to quietly install an INF-file from a batch script with the help of:
C:\>%SystemRoot%\System32\rundll32.exe advpack.dll,LaunchINFSectionEx "D:\imdisk.inf",,,4
C:\>echo %errorlevel%
0

Open in new window

... as documented here:
http://msdn.microsoft.com/en-us/library/aa768006%28VS.85%29.aspx

This seems to work partly, meaning that the control panel applet and the user land CLI-application gets installed. However, trying to run these results in a complaint about the driver missing:
C:\>imdisk -a -s 33M
The ImDisk Virtual Disk Driver is not installed. Please re-install ImDisk.

Open in new window


Then doing this procedure from explorer.exe (right-click the .inf-file -> Install)  it works as a charm. What am I missing?

The software in question is ImDisk, found here:
http://www.ltr-data.se/opencode.html/#ImDisk

Also, the platform I'm trying to run this on is Windows XP SP3 x86. The user has admin-rights.
0
Comment
Question by:NordCap
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34135759
Wich OS you use? Try better to use dpinst.exe to install drivers.

http://www.microsoft.com/whdc/driver/install/32-64bit_install.mspx

or you can use devcon

http://support.microsoft.com/kb/311272
0
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34135846
Ok i see you use Win XP. Why you want to install the inf file? You can install the software silentlly from commandline

imdiskinst.exe -y
0
 

Author Comment

by:NordCap
ID: 34136416
Using imdiskinst -y is a good idea but when I said quiet I meant that I don't want anything to show up on the screen (except the batch window running). With imdiskinst -y you get a small window-flash and a progress-bar.

I've just tried my above mentioned command on Windows 7 x86 as well and the result is the same. I must be missing something. I also prefer to use a method that can be used on a vanilla release of Windows, hence no devcon.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:xylog
ID: 34139140
Do you need a reboot after install for the driver to become active?
0
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34139472
If you don't like the small popup window-flash you have only one way. you must repackage the package to a msi. But it can be very complex because the package contains a driver. i will try tomorow to create a install wrapper for silent installation
0
 

Author Comment

by:NordCap
ID: 34143153
@xylog
It does not need of a reboot, since installing the INF-file from explorer.exe works as expected.

@cyborgrd
I understand, however I'm not sure if packaging a msi is the best way to go. The command I posted above that uses LaunchINFSectionEx is totally silent, however, something is missing, wouldn't it be easier to look for the cause of it not installing the driver as expected?
0
 
LVL 3

Accepted Solution

by:
cyborgrd earned 500 total points
ID: 34143819
the LaunchINFSectionEx works not correctly with many drivers. I don't know the solution for it. The install wrapper don't work propertly. I see the window. May is a custom action in the vendor installer.
0
 

Author Comment

by:NordCap
ID: 34143869
I see, so in essence is it common that LaunchINFSectionEx does not work with all drivers? And there is no known reason for this?
0
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34143960
i has the same issue some time ago. I used the the dpinst and devcon for driver installations
0
 

Author Closing Comment

by:NordCap
ID: 34155019
I took a different kind of approach to "solving" this problem.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question