Jump to content

Snippet for OemPnPDriversPath, setDevicePath clone


idle.newbie

Recommended Posts

This script is nice btw, but I'd wonder why he didn't use a utility to update the winnt.sif.

That way he could replace the whole :RECREATE routine into this line:

nircmd inisetval "d:\xp_unattend\I386\winnt.sif" "Unattended" "OemPnPDriversPath" "~qTHIS_IS_THE_NEW_VALUE~q"

http://www.nirsoft.net/utils/nircmd.html

And does that work? If it does, I'll use that...

EDIT: the syntax inisetval isn't listed? :o

Edited by Bâshrat the Sneaky
Link to comment
Share on other sites


Okay, I created my own, and this one definitely works for me. Just modify the 3 values in the begin of my script. The driver_prefix is just the name that should be prefixed for every folder that contains an INF-file.

The drivers_path and winnt_file should be surrounded by quotes if you have spaces in your path. Make sure you've downloaded nircmd.

@echo off

set drivers_path=D:\xp_unattend\$oem$\$1\drivers
set drivers_prefix=drivers
set winnt_file=D:\xp_unattend\i386\winnt.sif

call :traverse %drivers_path% %drivers_prefix%
nircmd.exe inisetval %winnt_file% "Unattended" "OemPnPDriversPath" "~q%newPath%~q"
goto :eof


:traverse
 pushd %~f1
 if EXIST *.inf (
   if NOT DEFINED newPath (
     set newPath=%~2
   ) else (
     call set newPath=%%newPath%%;%~2
   )
 )
 for /d %%I in (*) do (
   call :traverse "%%I" "%2\%%I"
 )
 popd
goto :eof

Edited by Afterdawn
Link to comment
Share on other sites

I'll test it immediately!

EDIT: AT LAST some results!!!! Superb :)

2 questions:

[FIXED] 1) is it case-sensitive for the inf file? I assume yes? How to solve it? Simply add the same but then replace *.inf by *.INF?

>> It ISN'T case-sensitive!!!

[FIXED] 2) Isn't it possible to make it no longer required to enter the full path?

>>You CAN use relative path, if nircmd.exe and the cmd file are on top of both the driversfolder and the I386 folder!

I LOVE YOU :thumbup:wacko::blink:

Have been searching on this a very long time!

Edited by Bâshrat the Sneaky
Link to comment
Share on other sites

I'll test it immediately!

EDIT: AT LAST some results!!!! Superb :)

2 questions:

[FIXED] 1) is it case-sensitive for the inf file? I assume yes?  How to solve it? Simply add the same but then replace *.inf by *.INF?

>> It ISN'T case-sensitive!!!

[FIXED] 2) Isn't it possible to make it no longer required to enter the full path?

>>You CAN use relative path, if nircmd.exe and the cmd file are on top of both the driversfolder and the I386 folder!

I LOVE YOU  :thumbup  :wacko:  :blink:

Have been searching on this a very long time!

Okay good to hear that it finally works for you now!

And you're right, the winnt.sif file can be relative!

Link to comment
Share on other sites

nircmd.exe inisetval %winnt_file% "Unattended" "OemPnPDriversPath" "~q%newPath%~q"

I need to apply this piece of code somewhere else as well..

I've searched the net, but couldn't find anything about the '~q' you used... What is it for???

Can you please verify this piece of code?

SET %D%=DriverPack
SET %G%=Graphics
SET %S%=Sound
SET %IE%=IF EXIST

ROBOCOPY M%M% "%CD%" *.* /E /MOV /NS /NC /NFL /NDL /NP /NJH /NJS
%IE% I386\presetup.cmd (
%IE% OEM\%D%_%G%_V*.7z nircmd.exe inisetval I386\winnt.sif "GUIRunOnce" "command7" "~q%IE% %SYSTEMDRIVE%\DP\G\%G%_Control_Panels.cmd %SYSTEMDRIVE%\DP\G\%G%_Control_Panels.cmd~q"
%IE% OEM\%D%_%S%_V*.7z nircmd.exe inisetval I386\winnt.sif "GUIRunOnce" "command7" "~q%IE% %SYSTEMDRIVE%\DP\S\%S%_Control_Panels.cmd %SYSTEMDRIVE%\DP\S\%S%_Control_Panels.cmd~q"
) ELSE (
%IE% $OEM$\$1\DP\G\%G%_Control_Panels.cmd nircmd.exe inisetval I386\winnt.sif "GUIRunOnce" "command8" "~q%IE% %SYSTEMDRIVE%\DP\G\%G%_Control_Panels.cmd %SYSTEMDRIVE%\DP\G\%G%_Control_Panels.cmd~q"
%IE% $OEM$\$1\DP\S\%S%_Control_Panels.cmd nircmd.exe inisetval I386\winnt.sif "GUIRunOnce" "command8" "~q%IE% %SYSTEMDRIVE%\DP\S\%S%_Control_Panels.cmd %SYSTEMDRIVE%\DP\S\%S%_Control_Panels.cmd~q"
)
ECHO.
ECHO _ commands added to winnt.sif to install %D% %G%/%S% control panels...
)

Note: I can guarantee you that all required files are present, please just verify the (syntax of) the code!

Thanks!

Link to comment
Share on other sites

@ Bâshrat the Sneaky

The ~q makes sure that the entry added to OemPnpDriversPath is surrounded by double quotes... just like it should be.

The help for NIRCMD is contained in the Help file that's included!

About your script.. it's very difficult to see what's it doing / supposed to do.

Can't you just tell what you want... and then I could tell you how I should do it!

Link to comment
Share on other sites

@ Bâshrat the Sneaky

The ~q makes sure that the entry added to OemPnpDriversPath is surrounded by double quotes... just like it should be.

The help for NIRCMD is contained in the Help file that's included!

About your script.. it's very difficult to see what's it doing / supposed to do.

Can't you just tell what you want... and then I could tell you how I should do it!

Well, in fact it's very easy: if a certain file exists, nircmd adds some values to the winnt.sif file.

'visual' explanation:

IF method 2 (

if driverpack graphics M2 nircmd blabla

if driverpack sound M2 nircmd blabla

) else (

if driverpack graphics M1 nircmd blabla

if driverpack sound M1 nircmd blabla

)

I looked in that helpfile, but only ~$ is mentioned there!

@sixpack: thanks for the explanation! :)

Link to comment
Share on other sites

I must admit that the code isn't very clear! Replacing IF EXIST by %IE% isn't really helpfull IMHO.

Why don't you use clear syntax with indents.. something like your "visual code":

if exist (%file%) (
 if exist (%graphics_dp%) (
    graphics_dp.cmd
 )
 if exist (%lan_dp%) (
    lan_dp.cmd
 )
 nircmd BLA BLA BLA
) else (
 ETCETERA...
)

Link to comment
Share on other sites

  • 1 month later...

The script works perfect But I have one complaint.

When I want to do this with all the BTS driverpacks I get this error

output line too long in de DOS box.

This means that the output is too big for DOS to handle. The resulting winnt.sif or sysprep.inf is empty because the command could not be completed.

Is there a way to increase the output buffer for cmd.exe ?

Please advice! :(

Link to comment
Share on other sites

The driverbase is made for an unattended install to make a winnt.sif

But I want to make an unattended sysprep image with the oemdriverspath filled in the sysprep.inf.

so........

the output generated in de cmd box is to big! there's to much info for the dosbox to handle. when I remove a few driverbases everything works!

please assist.

Link to comment
Share on other sites

this is what I get!

C:\sysprep>OemPnPDriversPath.cmd C:\sysprep\DriverPacks c:\sysprep\inf\sysprep.i

nf

sysprep\DriverPacks\DriverPack_Graphics_A_V5021\DP\G\A\1;sysprep\DriverPacks\Dri

verPack_Graphics_A_V5021\DP\G\A\1\WDM_XP;sysprep\DriverPacks\DriverPack_Graphics

_A_V5021\DP\G\N;sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\A\2;sysprep\

DriverPacks\DriverPack_Graphics_B_V502\DP\G\I\1;sysprep\DriverPacks\DriverPack_G

raphics_B_V502\DP\G\I\2;sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\I\3;

sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\M\1;sysprep\DriverPacks\Driv

erPack_Graphics_B_V502\DP\G\M\2;sysprep\DriverPacks\DriverPack_Graphics_B_V502\D

P\G\M\3;sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\S\1;sysprep\DriverPa

cks\DriverPack_Graphics_B_V502\DP\G\S\2;sysprep\DriverPacks\DriverPack_Graphics_

B_V502\DP\G\S\3;sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\V\1;sysprep\

DriverPacks\DriverPack_Graphics_B_V502\DP\G\V\2;sysprep\DriverPacks\DriverPack_G

raphics_B_V502\DP\G\V\3;sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\V\4;

sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\V\5;sysprep\DriverPacks\Driv

erPack_Graphics_B_V502\DP\G\X\1;sysprep\DriverPacks\DriverPack_Graphics_B_V502\D

P\G\X\1\WDM;sysprep\DriverPacks\DriverPack_Graphics_B_V502\DP\G\X\2;sysprep\Driv

erPacks\DriverPack_LAN_V502\DP\L\3\1;sysprep\DriverPacks\DriverPack_LAN_V502\DP\

L\3\2;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\3\3;sysprep\DriverPacks\Drive

rPack_LAN_V502\DP\L\B;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\B\2;sysprep\D

riverPacks\DriverPack_LAN_V502\DP\L\BU\1;sysprep\DriverPacks\DriverPack_LAN_V502

\DP\L\BU\2;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\BU\3;sysprep\DriverPacks

\DriverPack_LAN_V502\DP\L\D\1;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\D\2;s

ysprep\DriverPacks\DriverPack_LAN_V502\DP\L\D\3;sysprep\DriverPacks\DriverPack_L

AN_V502\DP\L\D\4;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\D\5;sysprep\Driver

Packs\DriverPack_LAN_V502\DP\L\D\6;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\

D\7;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\D\8;sysprep\DriverPacks\DriverP

ack_LAN_V502\DP\L\I;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\L\1;sysprep\Dri

verPacks\DriverPack_LAN_V502\DP\L\L\2;sysprep\DriverPacks\DriverPack_LAN_V502\DP

\L\L\3;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\L\3\B;sysprep\DriverPacks\Dr

iverPack_LAN_V502\DP\L\L\4;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\L\5;sysp

rep\DriverPacks\DriverPack_LAN_V502\DP\L\LI\1;sysprep\DriverPacks\DriverPack_LAN

_V502\DP\L\LI\2;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\LI\3;sysprep\Driver

Packs\DriverPack_LAN_V502\DP\L\LI\4;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L

\LI\5;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\LI\6;sysprep\DriverPacks\Driv

erPack_LAN_V502\DP\L\LI\7;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\M;sysprep

\DriverPacks\DriverPack_LAN_V502\DP\L\MI;sysprep\DriverPacks\DriverPack_LAN_V502

\DP\L\N\1;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\N\2;sysprep\DriverPacks\D

riverPack_LAN_V502\DP\L\N\3;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\N\4;sys

prep\DriverPacks\DriverPack_LAN_V502\DP\L\N\5;sysprep\DriverPacks\DriverPack_LAN

_V502\DP\L\N\6;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\N\7;sysprep\DriverPa

cks\DriverPack_LAN_V502\DP\L\N\8;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\NV

;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\O\1;sysprep\DriverPacks\DriverPack

_LAN_V502\DP\L\O\2;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\O\3;sysprep\Driv

erPacks\DriverPack_LAN_V502\DP\L\O\4;sysprep\DriverPacks\DriverPack_LAN_V502\DP\

L\O\5;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\O\6;sysprep\DriverPacks\Drive

rPack_LAN_V502\DP\L\O\7;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\O\8;sysprep

\DriverPacks\DriverPack_LAN_V502\DP\L\R\1;sysprep\DriverPacks\DriverPack_LAN_V50

2\DP\L\R\2;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\S;sysprep\DriverPacks\Dr

iverPack_LAN_V502\DP\L\SM\1;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\SM\2;sy

sprep\DriverPacks\DriverPack_LAN_V502\DP\L\SM\3;sysprep\DriverPacks\DriverPack_L

AN_V502\DP\L\SM\4;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\SM\5;sysprep\Driv

erPacks\DriverPack_LAN_V502\DP\L\SM\6;sysprep\DriverPacks\DriverPack_LAN_V502\DP

\L\SM\7;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\SM\8;sysprep\DriverPacks\Dr

iverPack_LAN_V502\DP\L\SM\9;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\T;syspr

ep\DriverPacks\DriverPack_LAN_V502\DP\L\V\1;sysprep\DriverPacks\DriverPack_LAN_V

502\DP\L\V\2;sysprep\DriverPacks\DriverPack_LAN_V502\DP\L\V\3;sysprep\DriverPack

s\DriverPack_MassStorage_V503\DP\M\3\1;sysprep\DriverPacks\DriverPack_MassStorag

e_V503\DP\M\3\2;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\3\3;sysprep

\DriverPacks\DriverPack_MassStorage_V503\DP\M\A\1;sysprep\DriverPacks\DriverPack

_MassStorage_V503\DP\M\A\2;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\

A\3;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\A\4;sysprep\DriverPacks

\DriverPack_MassStorage_V503\DP\M\A\5;sysprep\DriverPacks\DriverPack_MassStorage

_V503\DP\M\A\6;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\A\7;sysprep\

DriverPacks\DriverPack_MassStorage_V503\DP\M\A\8;sysprep\DriverPacks\DriverPack_

MassStorage_V503\DP\M\AD\1;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\

AD\2;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\AD\3;sysprep\DriverPac

ks\DriverPack_MassStorage_V503\DP\M\AD\4;sysprep\DriverPacks\DriverPack_MassStor

age_V503\DP\M\AD\5;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\AD\6;sys

prep\DriverPacks\DriverPack_MassStorage_V503\DP\M\AD\7;sysprep\DriverPacks\Drive

rPack_MassStorage_V503\DP\M\AD\8;sysprep\DriverPacks\DriverPack_MassStorage_V503

\DP\M\AL;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\AM;sysprep\DriverP

acks\DriverPack_MassStorage_V503\DP\M\AR;sysprep\DriverPacks\DriverPack_MassStor

age_V503\DP\M\D;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\H\1;sysprep

\DriverPacks\DriverPack_MassStorage_V503\DP\M\H\2;sysprep\DriverPacks\DriverPack

_MassStorage_V503\DP\M\H\3;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\

H\4;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\IB\1;sysprep\DriverPack

s\DriverPack_MassStorage_V503\DP\M\IB\2;sysprep\DriverPacks\DriverPack_MassStora

ge_V503\DP\M\IN\1;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\IN\2;sysp

rep\DriverPacks\DriverPack_MassStorage_V503\DP\M\IT;sysprep\DriverPacks\DriverPa

ck_MassStorage_V503\DP\M\L\1;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\

M\L\2;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\L\3;sysprep\DriverPac

ks\DriverPack_MassStorage_V503\DP\M\L\4;sysprep\DriverPacks\DriverPack_MassStora

ge_V503\DP\M\N;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\P\1;sysprep\

DriverPacks\DriverPack_MassStorage_V503\DP\M\P\2;sysprep\DriverPacks\DriverPack_

MassStorage_V503\DP\M\P\3;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\P

\4;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\P\5;sysprep\DriverPacks\

DriverPack_MassStorage_V503\DP\M\P\6;sysprep\DriverPacks\DriverPack_MassStorage_

V503\DP\M\P\7;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\P\8;sysprep\D

riverPacks\DriverPack_MassStorage_V503\DP\M\Q\1;sysprep\DriverPacks\DriverPack_M

assStorage_V503\DP\M\Q\2;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\Q\

3;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\Q\4;sysprep\DriverPacks\D

riverPack_MassStorage_V503\DP\M\S\1;sysprep\DriverPacks\DriverPack_MassStorage_V

503\DP\M\S\2;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\S\3;sysprep\Dr

iverPacks\DriverPack_MassStorage_V503\DP\M\S\4;sysprep\DriverPacks\DriverPack_Ma

ssStorage_V503\DP\M\S\5;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\S\6

;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\S\7;sysprep\DriverPacks\Dr

iverPack_MassStorage_V503\DP\M\SI\1;sysprep\DriverPacks\DriverPack_MassStorage_V

503\DP\M\V\1;sysprep\DriverPacks\DriverPack_MassStorage_V503\DP\M\V\2;sysprep\Dr

iverPacks\DriverPack_Sound_A_V5031\DP\S\CR\LS\Win2K_XP;sysprep\DriverPacks\Drive

rPack_Sound_A_V5031\DP\S\CR\WDM;sysprep\DriverPacks\DriverPack_Sound_A_V5031\DP\

S\N;sysprep\DriverPacks\DriverPack_Sound_A_V5031\DP\S\R;sysprep\DriverPacks\Driv

erPack_Sound_A_V5031\DP\S\R\HD;sysprep\DriverPacks\DriverPack_Sound_A_V5031\DP\S

\V;sysprep\DriverPacks\DriverPack_Sound_B_V503\DP\S\A

The output is too long.

the syntax of the command is wrong.

You see he only gets to Driverpack sound b which is the second of the total of 6!

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
  • Recently Browsing   0 members

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