Results 1 to 3 of 3

Thread: .inf file will not run from the command line

  1. #1
    Join Date
    Aug 2005
    Posts
    13

    .inf file will not run from the command line

    I have got an .inf gile which usually installs properly when I right click on it and select install but when I execute the command:
    rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
    LatexWithoutCommandPrompt.inf

    Then I am getting "Installation failed". You can check the whole file which is written below. Also note that a few lines may have wrapped. Thanks


    "LaTeX Without Command Prompt" (LaWCP) Utility
    ;
    ; Michael A. Covington - 2004
    ;
    ; This script makes it possible to run LaTeX and TeXify
    ; by right-clicking on the files.

    ; TO INSTALL:
    ; First make any necessary changes in the [Strings] section.
    ; Then right-click on the .inf file and choose Install.
    ;
    ; To install from the command line or in a .bat file:
    ; rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
    LatexWithoutCommandPrompt.inf
    ;
    ; To uninstall, use Control Panel, Add/Remove Programs
    ; or use the same command but with "DefaultUninstall" instead of
    "DefaultInstall".

    [Version]
    signature="$Windows NT$"


    ;; Definitions of strings used subsequently

    [Strings]

    EDITOR="c:\Program Files\pfe\pfe32.exe" ; editor with which to open TeX
    files
    BACKUP=".$$$" ; extension of editor backup
    files

    LATEX="c:\texmf\miktex\bin\latex.exe" ; locations of TeX programs...
    TEXIFY="c:\texmf\miktex\bin\texify.exe"
    DVIPS="c:\texmf\miktex\bin\dvips.exe"

    NAME="LaTeX Without Command Prompt utility" ; name
    to use for uninstall
    UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\LaWCP" ; where
    to keep the uninstall info
    FILENAME="LatexWithoutCommandPrompt.inf" ; this
    file


    ;; How to install and uninstall

    [DefaultInstall]
    CopyFiles = LaWCP.Files.Inf
    AddReg = LaWCP.Reg

    [DefaultUninstall]
    DelFiles = LaWCP.Files.Inf
    DelReg = LaWCP.Reg


    ;; How to copy the .inf file from its present location
    ;; to the windows INF folder (directory 17) so it will be available
    ;; at uninstall time

    [DestinationDirs]
    LaWCP.Files.Inf = 17

    [LaWCP.Files.Inf]
    %FILENAME%



    ;; Registry entries to be installed (and removed upon uninstallation).
    ;; Throughout, %11% is windows\system32, where cmd.exe resides.

    [LaWCP.Reg]

    ;; Label editor backup files as such, and always show their extensions
    HKCR,"%BACKUP%",,,"Editor Backup File"
    HKCR,"%BACKUP%",AlwaysShowExt

    ;; Always show extensions of the following file types

    HKCR,".aux",AlwaysShowExt
    HKCR,".lof",AlwaysShowExt
    HKCR,".log",AlwaysShowExt
    HKCR,".lot",AlwaysShowExt
    HKCR,".toc",AlwaysShowExt
    HKCR,".ps", AlwaysShowExt
    HKCR,psfile,AlwaysShowExt
    HKCR,txtfile,AlwaysShowExt

    ;; Options for .tex and .ltx files

    HKCR,".ltx",,,"LaTeX.Document"
    HKCR,".ltx",AlwaysShowExt

    HKCR,".tex",,,"LaTeX.Document"
    HKCR,".tex",AlwaysShowExt

    HKCR,LaTeX.Document\shell\open,,,"Open"
    HKCR,LaTeX.Document\shell\open\command,,,"""%EDITOR%"" ""%1"""

    HKCR,LaTeX.Document\shell\latex
    HKCR,LaTeX.Document\shell\latex,,,"LaTeX"
    HKCR,LaTeX.Document\shell\latex\command,,,"""%11%\cmd.exe"" /s /c ""color f0
    && ""%LATEX%"" ""%1"" && echo. && pause"""

    HKCR,LaTeX.Document\shell\latextwice
    HKCR,LaTeX.Document\shell\latextwice,,,"TeXify"
    HKCR,LaTeX.Document\shell\latextwice\command,,,"""%11%\cmd.exe"" /s /c
    ""color f0 && ""%TEXIFY%"" ""%1"" && echo. && pause"""

    ;; Options for .dvi files

    HKCR,".dvi",,,LaTeX.DVI
    HKCR,".dvi",AlwaysShowExt

    HKCR,LaTeX.DVI\shell\dvips
    HKCR,LaTeX.DVI\shell\dvips,,,"DVIPS"
    HKCR,LaTeX.DVI\shell\dvips\command,,,"""%11%\cmd.exe"" /s /c ""color 70 &&
    ""%DVIPS%"" ""%1"" && echo. && pause"""

    ;; Icons.
    ;; These are taken from Windows' stock set, so they are also used for other
    purposes.

    HKCR,LaTeX.Document\DefaultIcon,,,"""%11%\shell32.dll"",-151" ; page with
    a gear on it
    HKCR,LaTeX.DVI\DefaultIcon,,, """%11%\shell32.dll"",-153" ; window
    with a gear in it

    ;; How to uninstall this package using Add/Remove Programs

    HKLM,%UDHERE%,DisplayName,,"%NAME%"
    HKLM,%UDHERE%,UninstallString,,"rundll32.exe setupapi,InstallHinfSection
    DefaultUninstall 132 %17%\%FILENAME%"

    ;; END.

  2. #2
    Join Date
    Aug 2005
    Posts
    13

    Re: .inf file will not run from the command line

    Alright, so I found out that the command needs to be the below:

    rundll32.exe setupapi,InstallHinfSection DefaultInstall 132
    ..\LatexWithoutCommandPrompt.inf

    I dont know why the .\ is necessary to make it start in its own directory under all circumstances.

  3. #3
    Join Date
    Aug 2007
    Posts
    1
    You are right, you need to specify a path to the inf on the cmd line and not just the file name.

Similar Threads

  1. How to Turn File Sharing On/Off via command line?
    By Obessed in forum Networking & Security
    Replies: 3
    Last Post: 10-11-2010, 02:40 AM
  2. How to create a .ISO File and burn a CD, via command-line
    By Dubeyji in forum Windows Software
    Replies: 6
    Last Post: 15-09-2010, 06:00 AM
  3. Create torrent-file via command line
    By GurdeepS in forum Technology & Internet
    Replies: 8
    Last Post: 23-06-2010, 06:52 AM
  4. Software to break a PDF file from the command line
    By AmdUser in forum Windows Software
    Replies: 2
    Last Post: 05-05-2009, 02:48 PM
  5. Add a File Printer port from Command Line
    By mandalorian2 in forum Software Development
    Replies: 0
    Last Post: 29-04-2008, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,632,806.01914 seconds with 17 queries