Jump to content

OemPnPDriversPath Enumeration


redfive19
 Share

Recommended Posts

This forum has given so much to me so I wanted to give back....I wrote this script to enumerate a folder structure and make it ready for a sysprep.inf. It's pretty simple and makes use of FileListToArray3.au3 (which I got from this forum, can't remember the author - SORRY!!) Hope this helps someone!!

#Include <File.au3>
#include <FileListToArray3.au3>
#include <array.au3>


$folder = FileSelectFolder ( "Choose the DRV folder", '', 1)
If @error = 1 Then
    Exit
EndIf

If MsgBox(64+4, 'New .INF file', 'Create a new .INF file?') = 6 Then
    $sysprepfile = FileSaveDialog('Save .INF file', '', ".INF files (*.inf)", 2)
Else
    MsgBox(0, 'DISCLAIMER', 'THIS APP WILL WRITE THE RECURSIVE DIRECTORY STRUCTURE OF A TOP FOLDER TO SYSPREP.INF'  & @CRLF & _
                        'PLEASE MAKE SURE YOU HAVE BACKED UP YOUR SYSPREP.INF BEFORE RUNNING THIS TOOL!!!')
    $sysprepfile = FileOpenDialog('Choose .INF file', '', ".INF files (*.inf)")
EndIf


If @error = 1 Then
    Exit
EndIf
If StringRight($sysprepfile, 4) <> '.inf' Then
    $sysprepfile = $sysprepfile & '.inf'
EndIf

$drvstringarray = StringSplit($folder, '\')
$x = $drvstringarray[0]
$topfolder = $drvstringarray[$x]

$drvarray = _FileListToArray3($folder, "*", 2, 1, 0, '')
$drvfolder = '\' & $topfolder & '\' & $drvarray[1] & ';'
For $a = 2 to $drvarray[0]
    $drvfolder = $drvfolder & '\' & $topfolder & '\' & $drvarray[$a] & ';'
Next
$drvfolder = StringTrimRight($drvfolder, 1)
IniWrite($sysprepfile, 'Unattended', 'OemPnPDriversPath', '"' & $drvfolder & '"')

FileListToArray3.au3

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...