Announcement

Collapse
No announcement yet.

Programmatically install a device driver

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Programmatically install a device driver


    Im trying to install a driver programmatically, but i dont want to reinvent the wheel.
    however my searches return ambiguous results. Basically what im trying to do is to
    check wether the user is in an administrator account and if so, proceed with the
    driver installation. Probably with the SetupCopyOEMInf() function. Has anybody
    done this in the past?

    Thanks.



    www.pluribasic.com

  • #2
    https://docs.microsoft.com/en-us/win...-isuseranadmin

    Code:
    #Include "ShlObj.inc"
    
    ' DECLARE FUNCTION IsUserAnAdmin LIB "Shell32.dll" ALIAS "IsUserAnAdmin" () _
        AS LONG
    
    Con.StdOut("IsUserAnAdmin: " & Switch$(IsFalse(IsUserAnAdmin), "False", IsTrue(IsUserAnAdmin), "True"))
    Result elevated command prompt:
    IsUserAnAdmin: True
    Result normal command prompt:
    IsUserAnAdmin: False

    Comment


    • #3
      If it is a printer driver and on windows 7 then a user can install a printer driver and you can also set a few defaults ahead of time too. Like privileged to contol the spooler.
      p purvis

      Comment

      Working...
      X