Jump to content

hkazemi

Member
  • Posts

    5
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About hkazemi

hkazemi's Achievements

0

Reputation

  1. And how do you propose that we detect what the correct HAl should be? I have yet to figure out a way to do this from a loaded version of XP. Everything I have tried always returns the installed HAl not the one it should be. Got any suggestions? If you're dealing solely with ACPI HAL computers, here's my suggestion: First, detect processors using the following command line versions of Device Manager: DEVCON find ACPI\GENUINEINTEL* DEVCON find ACPI\AUTHENTICAMD* The output of these commands will show you how many processors were found and info about each of them. This output can be fed into another script. 1.) use the PIC ACPI HAL by default (it seems to work on all the ACPI machines I've tried) 2.) enable multiprocessor APIC ACPI HAL on multiprocessor/multicore/hyperthreading computers 3.) enable uniprocessor APIC ACPI HAL on single processor computers supporting APIC. These are likely going to be the same motherboards as the used for the multiprocessor APIC ACPI HAL. Choose option 2 whenever you detect multiple processors on any recent PC. Choose option 3 when you detect a recent vintage single processor (e.g. a Core architecture based Celeron). I've read, but not verified, that Device Manager and DEVCON will not automatically detect/show multiple processors that are separate physical CPUs. (I.e. only multiple core CPUs will show their additional processors in Device Manager/Devcon before they're enabled. Machines needing the non-ACPI HALs are not covered by the above, although they're going to be rare amongst any computer made since 2002. P.S. The tool 'MySysprep' has some additional HAL changing capabilities you may be interested in. It lets you preconfigure which HAL to use on which computers. (This is a manual preconfigure, not an auto-detect of the proper HAL.) See http://mysysprep.freeforums.org/ P.P.S. My own experience is that the %NUMBER_OF_PROCESSORS% environment variable does not always show the correct number, at least on some dual-core computers. I don't know about true dual-processor computers.
  2. Thanks for looking at this. I just downloaded this version and have been testing it. My first impression is I like how concise your code is. Here are my other observations: 1.) when at a command prompt, I prefer that programs do not clear the screen (CLS) because I like to be able to be able to scroll back to previous entries in the scroll buffer. (easily changed in the first line of your script). 2.) why is command 'Pause>Nul&Goto :Eof' used instead of simply jumping to the end of the file and returning to the command prompt? 3.) on a large directory parsing, periodic on-screen updates are useful to let the user know things are still working (this is why I had a message echoed to the screen on every directory in the version I posted) 4.) some INFs result in lines that are duplicates of each other. ichXdev.inf, a part of the Intel chipset drivers definitely does this, as does MassStorage INF dp\D\M\C1\CPQCISSM.inf. Looking at the output file in Excel makes the duplication very clear, although it appears to not happen every time. This problem also affects the version I had posted. One possible solution is to apply the 'sort' command and then the 'uniq' command to the output which will eliminate the duplicates, at the expense of needing 2 more separate programs. Eliminating duplicate lines may speed up the Sysprep process and/or prevent conflicts, depending on how Sysprep behaves when encounters a duplicate MassStorage driver entry. 5.) when I ran it on a folder with a large number of drivers, I saw output like this (didn't happen on a small folder) (maybe some variables overflowed?): C:\>HwIDs.cmd \drivers hwids.txt Beginning scan, this may take a while... PRADEONX1300Series=ati2mtag_RV515" "C:\drivers\shared\video\ati_catalyst_6-11_xp -2k_dd_37616\$OUTDIR\C2_38857.inf"PRADEONX1300Series=ati2mtag_RV515" "C:\drivers \shared\video\ati_catalyst_6-11_xp-2k_dd_37616\$OUTDIR\C2_38857.inf"PRADEONX1300 SeriesSecondary=ati2mtag_RV515" "C:\drivers\shared\video\ati_catalyst_6-11_xp-2k _dd_37616\$OUTDIR\C2_38857.inf"PRADEONX1300SeriesSecondary=ati2mtag_RV515" "C:\d rivers\shared\video\ati_catalyst_6-11_xp-2k_dd_37616\$OUTDIR\C2_38857.inf"PRADEO NX1600Series=ati2mtag_RV530" "C:\drivers\shared\video\ati_catalyst_6-11_xp-2k_dd <many similar lines snipped> 8857.inf"PRO-Secondary=ati2mtag_RV410" "C:\drivers\shared\video\ati_catalyst_6-1 1_xp-2k_dd_37616\$OUTDIR\CX_38857.inf"PRADEON9600SE=ati2mtag_RV350" "C:\drivers\ shared\video\ati_catalyst_6-11_xp-2k_dd_37616\$OUTDIR\CX_38857.inf"PRADEON9600SE -Secondary=ati2mtag_RV350" "C:\drivers\shared\video\ati_catalyst_6-11_xp-2k_dd_3 7616\$OUTDIR\CX_38857.inf"PRADEON9600XTBRAVO=ati2mtag_RV360" "C:\drivers\shared\ video\ati_catalyst_6-11_xp-2k_dd_37616\$OUTDIR\CX_38857.inf"PRADEON9600XTBRAVO-S econdary=ati2mtag_RV360" "C:\drivers\shared\video\ati_catalyst_6-11_xp-2k_dd_376 16\$OUTDIR\CX_38857.inf" Job Completed Press any key to End
  3. This Driverpack MassStorage INF causes the tab troubles that I addressed using SED: C:\D\M\IT\iteraid.inf This thread has some old posts highlighting the tab issue that was not addressed in the original version of HWIDS.CMD http://www.msfn.org/board/Unattended-syspr...ess-t43733.html The TRAVERSAL section was written by IcemanND. It loops over directory (and its subdirectories) that was specified on the command line, and then loops over every INF file in each of those directories. It then scans the INFs for HWIDS and outputs them to a file. The occaisonal 'File Not Found' error message comes from DIR *.INF not finding any INF in a directory.
  4. I have created a modifed/updated version of HWIDS.CMD that solves this extra tab (it's not really a space) problem. It is available online at: http://www.msfn.org/board/...-t115205.html and http://forum.driverpacks.net/viewtopic.php?id=1637&p=2
  5. Note 1: I posted this same message on the DriverPacks.net forum at http://forum.driverpacks.net/viewtopic.php?id=1637&p=2 , which is a more recent thread. I am reposting it here at the request of IcemanND, the author of the INF scanning engine in this script. Thanks for the original, IcemanND! Note 2: If someone knows how to change IcemanND's script to filter out the tab characters that sometimes got through the original script, then the dependency on SED.EXE will go away. --- I have taken the HWIDS script and improved it by solving several weaknesses in the original. The main caveat is it now requires SED.EXE, a free/GPL tool from http://gnuwin32.sourceforge.net/packages/sed.htm , to be somewhere on the system path. I used SED to remove the tab characters that Skillz reported in an earlier post. The list of improvements is in the code below. On the todo list would be automating the following: 1.) running sysprep -bmsd to insert the official MassStorage drivers into sysprep.inf (easy to do in a batch file) 2.) inserting of the output of this HWIDS script into the correct section of sysprep.inf, after the official drivers list, while verifying duplicate entries are not created in case a driver has been added on a previous insertion. (If someone has a good way of doing this, I'd love to hear it.) HWIDS.CMD (Inf Scanner) @echo off :: Core INF scanning and processing engine created by IcemanND and posted on MSFN Forums :: at http://www.msfn.org/board/lofiversion/index.php/t43413.html :: :: Note: I (HK) contacted IcemanND on MSFN on 4/7/2008 and asked him if it would be okay to :: release this modified version under both the GPL and Creative Commons Attribution licenses. :: His response was 'Feel free.' :: :: Reposted by Skillz on Driverpacks.net Forums at http://forum.driverpacks.net/viewtopic.php?pid=11604 :: Modified and expanded by Haudy Kazemi: :: -improved handling of paths with spaces in them (added quotes around '%cd%' in SET STDOUT line) :: -added error messages rather than silently exiting :: -added ability to configure filename of output file :: -added a check to see whether the output file name already exists to prevent accidental overwriting :: -cleaned up output and added status and progress information :: -Skillz reported that tab characters are not removed by the script. I worked around this problem :: with this command: sed -T -e "s/ //" hwids.txt > hwids-tabsremoved.txt :: (tested and found to work correctly using 'GNU sed version 4.1.5' on Windows XP) IF "%1"=="" GOTO INFO IF NOT EXIST %1 GOTO FOLDERNOTFOUND IF "%2"=="" GOTO NOOUTPUTFILE IF "%3"=="overwrite" GOTO SKIPOUTPUTFILECHECK IF EXIST "%2" GOTO OUTPUTFILEEXISTS :SKIPOUTPUTFILECHECK :: Check for SED.EXE on path (derived from sample code in viewpath.cmd on http://www.ss64.com/nt/path.html ) :: I (HK) contacted Simon Sheppard of ss64.com on 4/7/2008 about using a derivation of his code and :: releasing it under both the GPL and Creative Commons Attribution licenses. His response was 'Sure, no problem'. :: Note: I (HK) have put together a related script called ProgramPath that exposes this search-the-path-for-a-file :: ability directly on the command line. ::echo the path one line at a time for %%G in ("%path:;=" "%") do ( ::echo %%G\sed.exe IF EXIST %%G\sed.exe GOTO SEDEXEFOUND ) GOTO SEDEXENOTFOUND :SEDEXEFOUND echo Beginning scan...this may take a few minutes... SETLOCAL ENABLEDELAYEDEXPANSION SET STDOUT="%cd%"\%2 SET OUTPUTFILE=%2 TYPE>%STDOUT% 2>NUL ::traverse drivers path CALL :TRAVERSAL %1 ::Use sed to find and remove any tab characters in the output file ::This is a workaround for the problem reported by Skillz echo Running SED.EXE on %OUTPUTFILE% sed -T -e "s/ //" %OUTPUTFILE% > %OUTPUTFILE%-tabsremoved.txt del %OUTPUTFILE% ren %OUTPUTFILE%-tabsremoved.txt %OUTPUTFILE% echo Job completed. GOTO EOF :TRAVERSAL echo Processing %1 PUSHD %1 for /f %%f in ('dir /b *.inf') do ( echo Processing %1\%%f for /f "eol=- tokens=2 delims=," %%i in ('find /i "pci\ven" %%f') do ( for /f "tokens=*" %%j in ("%%i") do ( for /f "tokens=1* delims=_" %%k in ("%%j") do ( if /i "%%k" EQU "PCI\VEN" ( for /f "usebackq tokens=1* delims=; " %%a in ('%%j') do ( echo %%a=%cd%\%%f>>%STDOUT% ) ) ) ) ) ) FOR /F %%I IN ('DIR /AD /OGN /B') DO ( CALL :TRAVERSAL %CD%\%%I ) POPD GOTO EOF :INFO echo Inf Scanner 20080407 by Haudy Kazemi echo Credit is due to IcemanND for the core INF scanning engine, and echo to Simon Sheppard for his system path parsing example. echo Dual licensed under the GPL and Creative Commons Attribution License echo. echo This script is designed to scan a directory tree containing MassStorage device echo INFs to find their HWIDs and output them to a file that can then be added into echo a SYSPREP.INF. This script should work on any INFs, in case you want to echo gather a collection of HWIDs for other types of hardware. echo. echo HWIDS %%1 %%2 %%3 echo %%1 is the path to folder/tree containing DriverPack MassStorage or other INFs echo (e.g. C:\D\M ). echo %%2 is the name of an output file to store the HWIDS in (e.g. hwids.txt) echo %%3 should be the word 'overwrite' if you want to replace an existing output echo file of the same name echo. echo Messages of 'File Not Found' are normal. They are caused by the script's use echo of 'dir /b *.inf' coming across folders with no INF files in them. These can echo safely be ignored. goto EOF :FOLDERNOTFOUND echo ERROR: The specified folder was not found. echo Please specify another folder location. GOTO EOF :NOOUTPUTFILE echo ERROR: No output file specified. echo Please specify the name of an output file to store the HWIDS in (e.g. hwids.txt). GOTO EOF :OUTPUTFILEEXISTS echo ERROR: File overwrite prevented. echo You chose an output filename that already exists. Please delete that file, echo enable overwriting, or choose a different filename. GOTO EOF :SEDEXENOTFOUND echo ERROR: SED.EXE was not found anywhere in the system path. echo Please make it available on the system path. It is needed to remove echo extra tabs in the output file. echo Note: GNU sed version 4.1.5 is known to work correctly on Windows XP echo and can be obtained from http://gnuwin32.sourceforge.net/packages/sed.htm GOTO EOF :EOF I call HWIDS.CMD with another script named hwidscan.bat. This specifies the folder to scan, the name of the output file, and to force an overwrite of the output file if it already exists: HWIDSCAN.BAT :: Put together by Haudy Kazemi on 4/7/2008 to automate the HWIDS.CMD scan and update hwids.cmd c:\drivers\dp\D\M hwids.txt overwrite In the process of creating the improvements to HWIDS.CMD, I wrote code to verify that SED was available. Here is that code in a standalone form, called ProgramPath. It's job is to check to see if a program or file is available somewhere on the system path, and report back any locations it finds. PROGRAMPATH.CMD @echo off if "%1"=="" goto INFO ::echo the path one line at a time for %%G in ("%path:;=" "%") do ( ::echo %%G\%1 IF EXIST %%G\%1 echo %%G\%1 ) goto END :INFO :: I (HK) contacted Simon Sheppard of ss64.com on 4/7/2008 about using a derivation of his code and :: releasing it under both the GPL and Creative Commons Attribution licenses. His response was 'Sure, no problem'. :: Based on Simon Sheppard's viewpath.cmd :: at http://www.ss64.com/nt/path.html :: and http://www.ss64.org/dl1/ss64win.zip echo ProgramPath 20080407 by Haudy Kazemi echo Credit is due to Simon Sheppard for his system path parsing example. echo Dual licensed under the GPL and Creative Commons Attribution License echo. echo Checks to see if a program or file is available on the system path: echo PROGRAMPATH %%1 echo where %%1 is the name of the file you want to check for echo. :END
×
×
  • Create New...