1. Hãy ủng hộ PhienBanMoi.Com bằng cách LIKE trang FANPAGE , GOOGLE+ dưới mỗi bài viết hoặc chia sẻ website nếu thấy hữu ích. Trân trọng cảm ơn!
  2. [Thông Báo] Thông Báo Tuyển mod cho toàn diễn đàn


    Forum mới lập rất cần sự giúp đỡ của các bạn vậy nên bạn nào có khả năng thì đăng kí tham gia làm mod để quản lí, phát triển diễn đàn nhé!

Batch Script Rebuild Icon & HardwareIDs

Thảo luận trong 'Tin Học - Lập Trình' bắt đầu bởi MaterSystem, 21 Tháng mười một 2014.


  1. MaterSystem

    MaterSystem Member Danh Tiếng

    714
    359
    63
    1. Rebuild Icon: nhiệm vụ chính trích xuất AVI, BMP, ICON, DIALOG, MENU cây tài nguyên (.avi, .bmp, .res), tự động tạo script mod ResHacker (tên_file_mod.txt), hỗ trợ công việc tạo gói IconPack với Skin Pack Install System

    Cấu trúc: gồm 3 file nằm cùng 1 thư mục
    + ResHacker.exe: file chương trình chính ResHacker
    + list.txt: danh sách file cần tạo script mod ResHacker
    + Rebuild Icon.bat: kịch bản tự động thực hiện nhiệm vụ trên

    Rebuild Icon.bat
    Show Spoiler
    Mã:
    @echo off
    cls
    setlocal enabledelayedexpansion
    for /f "tokens=*" %%i in (list.txt) do (echo %%~ni%%~xi
    md "%cd%\%%~ni%%~xi\file\"
    copy "%%i" "%cd%\%%~ni%%~xi\file\%%~ni%%~xi" 1>nul
    ResHacker.exe -extract "%cd%\%%~ni%%~xi\file\%%~ni%%~xi", "%cd%\%%~ni%%~xi\file\%%~ni%%~xi.rc", , ,
    call :script "%cd%\%%~ni%%~xi")
    setlocal disabledelayedexpansion
    pause
    exit
    
    :script
    echo [FILENAMES]>>"%cd%\%~n1%~x1\%~n1%~x1.txt"
    echo Exe="Backup\%~n1%~x1">>"%cd%\%~n1%~x1\%~n1%~x1.txt"
    echo SaveAs="NewFiles\%~n1%~x1">>"%cd%\%~n1%~x1\%~n1%~x1.txt"
    echo Log="Logs\%~n1%~x1.log">>"%cd%\%~n1%~x1\%~n1%~x1.txt"
    echo.>>"%cd%\%~n1%~x1\%~n1%~x1.txt"
    echo [COMMANDS]>>"%cd%\%~n1%~x1\%~n1%~x1.txt"
    for /f "tokens=1,2,3" %%i in ('find "AVI" "%cd%\%~n1%~x1\file\%~n1%~x1.rc"') do (
    if "%%~xk" == ".avi" (copy "%cd%\%~n1%~x1\file\%%~nk%%~xk" "%cd%\%~n1%~x1\AVI_%%i.avi" 1>nul
    echo -addoverwrite "Resources\%~n1%~x1\AVI_%%i.avi", AVI, %%i,>>"%cd%\%~n1%~x1\%~n1%~x1.txt")
    )
    for /f "tokens=1,2,3" %%i in ('find "BITMAP" "%cd%\%~n1%~x1\file\%~n1%~x1.rc"') do (
    if "%%~xk" == ".bmp" (copy "%cd%\%~n1%~x1\file\%%~nk%%~xk" "%cd%\%~n1%~x1\Bitmap_%%i.bmp" 1>nul
    echo -addoverwrite "Resources\%~n1%~x1\Bitmap_%%i.bmp", BITMAP, %%i,>>"%cd%\%~n1%~x1\%~n1%~x1.txt")
    )
    for /f "tokens=1,2" %%i in ('find "DIALOG" "%cd%\%~n1%~x1\file\%~n1%~x1.rc"') do (
    if "%%j" == "DIALOG" (ResHacker.exe -extract "%cd%\%~n1%~x1\file\%~n1%~x1", "%cd%\%~n1%~x1\Dialog_%%i.res", DIALOG, %%i,
    echo -addoverwrite "Resources\%~n1%~x1\Dialog_%%i.res", DIALOG, %%i,>>"%cd%\%~n1%~x1\%~n1%~x1.txt")
    if "%%j" == "DIALOGEX" (ResHacker.exe -extract "%cd%\%~n1%~x1\file\%~n1%~x1", "%cd%\%~n1%~x1\DialogEx_%%i.res", DIALOG, %%i,
    echo -addoverwrite "Resources\%~n1%~x1\DialogEx_%%i.res", DIALOGEX, %%i,>>"%cd%\%~n1%~x1\%~n1%~x1.txt")
    )
    for /f "tokens=1,2,3" %%i in ('find "ICON" "%cd%\%~n1%~x1\file\%~n1%~x1.rc"') do (
    if "%%~xk" == ".ico" (copy "%cd%\%~n1%~x1\file\%%~nk%%~xk" "%cd%\%~n1%~x1\Icon_%%i.ico" 1>nul
    echo -addoverwrite "Resources\%~n1%~x1\Icon_%%i.ico", ICONGROUP, %%i,>>"%cd%\%~n1%~x1\%~n1%~x1.txt")
    )
    for /f "tokens=1,2" %%i in ('find "MENU" "%cd%\%~n1%~x1\file\%~n1%~x1.rc"') do (
    if "%%j" == "MENU" (ResHacker.exe -extract "%cd%\%~n1%~x1\file\%~n1%~x1", "%cd%\%~n1%~x1\Menu_%%i.res", Menu, %%i,
    echo -addoverwrite "Resources\%~n1%~x1\Menu_%%i.res", MENU, %%i,>>"%cd%\%~n1%~x1\%~n1%~x1.txt")
    if "%%j" == "MENUEX" (ResHacker.exe -extract "%cd%\%~n1%~x1\file\%~n1%~x1", "%cd%\%~n1%~x1\MenuEx_%%i.res", MENU, %%i,
    echo -addoverwrite "Resources\%~n1%~x1\MenuEx_%%i.res", MENUEX, %%i,>>"%cd%\%~n1%~x1\%~n1%~x1.txt")
    )
    copy "%cd%\%~n1%~x1\file\%~n1%~x1" "%cd%\%~n1%~x1\" 1>nul
    rd /s /q "%cd%\%~n1%~x1\file\"
    del /q "%cd%\%~n1%~x1\%~n1%~x1"


    list.txt: danh sách tham khảo
    Show Spoiler
    Mã:
    C:\WINDOWS\system32\access.cpl
    C:\WINDOWS\system32\acctres.dll
    C:\WINDOWS\system32\accwiz.exe
    C:\WINDOWS\system32\admparse.dll
    C:\WINDOWS\system32\en-US\admparse.dll.mui
    C:\WINDOWS\system32\ahui.exe
    C:\WINDOWS\system32\appmgr.dll
    C:\WINDOWS\system32\appwiz.cpl
    C:\WINDOWS\system32\asctrls.ocx
    C:\WINDOWS\system32\audiodev.dll
    C:\WINDOWS\system32\avtapi.dll
    C:\WINDOWS\system32\batmeter.dll
    C:\WINDOWS\system32\batt.dll
    C:\WINDOWS\system32\bcsprsrc.dll
    C:\WINDOWS\system32\browseui.dll
    C:\WINDOWS\system32\bthci.dll
    C:\WINDOWS\system32\bthprops.cpl
    C:\WINDOWS\system32\cabview.dll
    C:\WINDOWS\system32\calc.exe
    C:\WINDOWS\system32\charmap.exe
    C:\WINDOWS\system32\cleanmgr.exe
    C:\WINDOWS\system32\cmd.exe
    C:\WINDOWS\system32\cmdial32.dll
    C:\WINDOWS\system32\cmprops.dll
    C:\WINDOWS\system32\comctl32.dll
    C:\WINDOWS\system32\compatUI.dll
    C:\WINDOWS\system32\console.dll
    C:\WINDOWS\system32\credui.dll
    C:\WINDOWS\system32\cscui.dll
    C:\WINDOWS\system32\dataclen.dll
    C:\WINDOWS\system32\ddeshare.exe
    C:\WINDOWS\system32\desk.cpl
    C:\WINDOWS\system32\deskadp.dll
    C:\WINDOWS\system32\deskmon.dll
    C:\WINDOWS\system32\deskperf.dll
    C:\WINDOWS\system32\devmgr.dll
    C:\WINDOWS\system32\dfrgres.dll
    C:\WINDOWS\system32\dfrgui.dll
    C:\WINDOWS\system32\dfshim.dll
    C:\WINDOWS\system32\en-US\dfshim.dll.mui
    C:\Program Files\Windows NT\dialer.exe
    C:\WINDOWS\system32\digest.dll
    C:\WINDOWS\system32\dinput.dll
    C:\WINDOWS\system32\diskcopy.dll
    C:\WINDOWS\system32\dmdlgs.dll
    C:\WINDOWS\system32\dmdskres.dll
    C:\WINDOWS\system32\dpmodemx.dll
    C:\WINDOWS\system32\dpvoice.dll
    C:\WINDOWS\system32\drwtsn32.exe
    C:\WINDOWS\system32\dsprop.dll
    C:\WINDOWS\system32\dsquery.dll
    C:\WINDOWS\system32\dsuiext.dll
    C:\WINDOWS\system32\dvdplay.exe
    C:\WINDOWS\system32\els.dll
    C:\WINDOWS\system32\eventvwr.exe
    C:\WINDOWS\explorer.exe
    C:\WINDOWS\system32\fde.dll
    C:\WINDOWS\system32\filemgmt.dll
    C:\WINDOWS\system32\fldrclnr.dll
    C:\WINDOWS\system32\fontext.dll
    C:\WINDOWS\system32\freecell.exe
    C:\WINDOWS\system32\fsquirt.exe
    C:\WINDOWS\system32\fsusd.dll
    C:\WINDOWS\system32\fxsclntR.dll
    C:\WINDOWS\system32\fxscover.exe
    C:\WINDOWS\system32\fxssend.exe
    C:\WINDOWS\system32\gcdef.dll
    C:\WINDOWS\system32\gpedit.dll
    C:\WINDOWS\system32\gptext.dll
    C:\WINDOWS\system32\grpconv.exe
    C:\WINDOWS\system32\hdwwiz.cpl
    C:\WINDOWS\hh.exe
    C:\Program Files\Internet Explorer\hmmapi.dll
    C:\Program Files\Internet Explorer\en-US\hmmapi.dll.mui
    C:\WINDOWS\system32\hnetcfg.dll
    C:\WINDOWS\system32\hnetwiz.dll
    C:\WINDOWS\system32\hotplug.dll
    C:\WINDOWS\system32\hticons.dll
    C:\Program Files\Windows NT\hypertrm.exe
    C:\WINDOWS\system32\icmui.dll
    C:\Program Files\Internet Explorer\Connection Wizard\icwconn1.exe
    C:\Program Files\Internet Explorer\Connection Wizard\icwconn2.exe
    C:\WINDOWS\system32\icwdial.dll
    C:\WINDOWS\system32\ieaksie.dll
    C:\WINDOWS\system32\en-US\ieaksie.dll.mui
    C:\WINDOWS\system32\ieakui.dll
    C:\WINDOWS\system32\en-US\ieakui.dll.mui
    C:\WINDOWS\system32\ieframe.dll
    C:\WINDOWS\system32\en-US\ieframe.dll.mui
    C:\WINDOWS\system32\iepeers.dll
    C:\WINDOWS\system32\en-US\iepeers.dll.mui
    C:\WINDOWS\system32\iernonce.dll
    C:\WINDOWS\system32\en-US\iernonce.dll.mui
    C:\WINDOWS\system32\iesetup.dll
    C:\WINDOWS\system32\en-US\iesetup.dll.mui
    C:\Program Files\Internet Explorer\iexplore.exe
    C:\Program Files\Internet Explorer\en-US\iexplore.exe.mui
    C:\WINDOWS\system32\iexpress.exe
    C:\WINDOWS\system32\inetcpl.cpl
    C:\WINDOWS\system32\en-US\inetcpl.cpl.mui
    C:\WINDOWS\system32\inetcplc.dll
    C:\WINDOWS\system32\inetsrv\inetmgr.dll
    C:\WINDOWS\system32\inetppui.dll
    C:\WINDOWS\system32\inetres.dll
    C:\WINDOWS\system32\input.dll
    C:\WINDOWS\system32\intl.cpl
    C:\WINDOWS\system32\ipsecsnp.dll
    C:\WINDOWS\system32\ipsmsnap.dll
    C:\WINDOWS\system32\irclass.dll
    C:\WINDOWS\system32\irprops.cpl
    C:\WINDOWS\system32\isign32.dll
    C:\WINDOWS\system32\itss.dll
    C:\WINDOWS\system32\ivfsrc.ax
    C:\WINDOWS\system32\jobexec.dll
    C:\WINDOWS\system32\joy.cpl
    C:\WINDOWS\system32\keymgr.dll
    C:\WINDOWS\system32\localsec.dll
    C:\WINDOWS\system32\logonui.exe
    C:\WINDOWS\system32\magnify.exe
    C:\WINDOWS\system32\main.cpl
    C:\WINDOWS\system32\mapi32.dll
    C:\WINDOWS\system32\mapistub.dll
    C:\WINDOWS\system32\mciole32.dll
    C:\WINDOWS\system32\mdminst.dll
    C:\WINDOWS\system32\mdwmdmsp.dll
    C:\WINDOWS\system32\midimap.dll
    C:\WINDOWS\system32\usmt\migload.exe
    C:\WINDOWS\system32\migpwd.exe
    C:\WINDOWS\system32\usmt\migwiz.exe
    C:\WINDOWS\system32\mmc.exe
    C:\WINDOWS\system32\mmcbase.dll
    C:\WINDOWS\system32\mmcndmgr.dll
    C:\WINDOWS\system32\mmcshext.dll
    C:\WINDOWS\system32\mmsys.cpl
    C:\WINDOWS\system32\mnmsrvc.exe
    C:\WINDOWS\system32\mobsync.dll
    C:\WINDOWS\system32\mobsync.exe
    C:\WINDOWS\system32\modemui.dll
    C:\WINDOWS\system32\moricons.dll
    C:\Program Files\Movie Maker\moviemk.exe
    C:\WINDOWS\system32\mplay32.exe
    C:\WINDOWS\system32\mprui.dll
    C:\WINDOWS\system32\mqsnap.dll
    C:\WINDOWS\system32\mqutil.dll
    C:\WINDOWS\system32\msconf.dll
    C:\WINDOWS\pchealth\helpctr\binaries\msconfig.exe
    C:\WINDOWS\system32\mscorier.dll
    C:\WINDOWS\system32\msdtc.exe
    C:\WINDOWS\system32\msdxm.ocx
    C:\WINDOWS\system32\msgina.dll
    C:\WINDOWS\system32\mshearts.exe
    C:\WINDOWS\system32\mshta.exe
    C:\WINDOWS\system32\en-US\mshta.exe.mui
    C:\WINDOWS\system32\mshtml.dll
    C:\WINDOWS\system32\en-US\mshtml.dll.mui
    C:\WINDOWS\system32\msi.dll
    C:\WINDOWS\system32\msident.dll
    C:\WINDOWS\system32\msidntld.dll
    C:\WINDOWS\system32\msieftp.dll
    C:\WINDOWS\system32\msiexec.exe
    C:\WINDOWS\system32\msihnd.dll
    C:\Program Files\Outlook Express\msimn.exe
    C:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32.exe
    C:\Program Files\Messenger\msmsgs.exe
    C:\Program Files\Outlook Express\msoeres.dll
    C:\WINDOWS\system32\oobe\msoobe.exe
    C:\WINDOWS\system32\mspaint.exe
    C:\WINDOWS\system32\msratelc.dll
    C:\WINDOWS\system32\msrating.dll
    C:\WINDOWS\system32\en-US\msrating.dll.mui
    C:\WINDOWS\system32\msshavmsg.dll
    C:\WINDOWS\system32\mstask.dll
    C:\WINDOWS\system32\mstsc.exe
    C:\WINDOWS\system32\en-US\mstsc.exe.mui
    C:\WINDOWS\system32\mstscax.dll
    C:\WINDOWS\system32\en-US\mstscax.dll.mui
    C:\WINDOWS\system32\msutb.dll
    C:\WINDOWS\system32\msvfw32.dll
    C:\WINDOWS\system32\msxml.dll
    C:\WINDOWS\system32\msxmlr.dll
    C:\WINDOWS\system32\msxml2.dll
    C:\WINDOWS\system32\msxml2r.dll
    C:\WINDOWS\system32\msxml3.dll
    C:\WINDOWS\system32\msxml3r.dll
    C:\WINDOWS\system32\msxml6.dll
    C:\WINDOWS\system32\msxml6r.dll
    C:\WINDOWS\system32\mycomput.dll
    C:\WINDOWS\system32\mydocs.dll
    C:\WINDOWS\system32\narrator.exe
    C:\WINDOWS\system32\ncpa.cpl
    C:\WINDOWS\system32\netid.dll
    C:\WINDOWS\system32\netplwiz.dll
    C:\WINDOWS\system32\netsetup.exe
    C:\WINDOWS\system32\netshell.dll
    C:\WINDOWS\system32\newdev.dll
    C:\WINDOWS\system32\notepad.exe
    C:\WINDOWS\pchealth\helpctr\binaries\notiflag.exe
    C:\WINDOWS\system32\nslookup.exe
    C:\WINDOWS\system32\ntbackup.exe
    C:\WINDOWS\system32\ntkrnlmp.exe
    C:\WINDOWS\system32\ntkrnlpa.exe
    C:\WINDOWS\system32\ntkrpamp.exe
    C:\WINDOWS\system32\ntlanui.dll
    C:\WINDOWS\system32\ntlanui2.dll
    C:\WINDOWS\system32\ntoskrnl.exe
    C:\WINDOWS\system32\ntsd.exe
    C:\WINDOWS\system32\ntshrui.dll
    C:\WINDOWS\system32\nusrmgr.cpl
    C:\WINDOWS\system32\nwc.cpl
    C:\WINDOWS\system32\objsel.dll
    C:\WINDOWS\system32\occache.dll
    C:\WINDOWS\system32\en-US\occache.dll.mui
    C:\WINDOWS\system32\odbcad32.exe
    C:\WINDOWS\system32\odbccp32.cpl
    C:\WINDOWS\system32\odbcint.dll
    C:\Program Files\Outlook Express\oemig50.exe
    C:\WINDOWS\system32\ole32.dll
    C:\WINDOWS\system32\oobe\oobebaln.exe
    C:\WINDOWS\system32\osk.exe
    C:\WINDOWS\system32\osuninst.dll
    C:\WINDOWS\system32\osuninst.exe
    C:\WINDOWS\system32\packager.exe
    C:\WINDOWS\system32\pautoenr.dll
    C:\WINDOWS\system32\perfmon.exe
    C:\WINDOWS\system32\photowiz.dll
    C:\WINDOWS\system32\pifmgr.dll
    C:\WINDOWS\system32\powercfg.cpl
    C:\WINDOWS\system32\printui.dll
    C:\WINDOWS\system32\progman.exe
    C:\WINDOWS\system32\proquota.exe
    C:\WINDOWS\system32\psbase.dll
    C:\WINDOWS\system32\quartz.dll
    C:\WINDOWS\system32\rasdlg.dll
    C:\WINDOWS\system32\rasphone.exe
    C:\WINDOWS\system32\rcimlby.exe
    C:\WINDOWS\regedit.exe
    C:\WINDOWS\system32\regedt32.exe
    C:\WINDOWS\system32\regwizc.dll
    C:\WINDOWS\system32\remotepg.dll
    C:\WINDOWS\system32\Restore\rstrui.exe
    C:\WINDOWS\system32\rtcshare.exe
    C:\WINDOWS\system32\rundll32.exe
    C:\WINDOWS\system32\runonce.exe
    C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.cpl
    C:\WINDOWS\system32\scrobj.dll
    C:\WINDOWS\system32\scripting\scrobj.dll.mui
    C:\WINDOWS\system32\sendmail.dll
    C:\WINDOWS\system32\servdeps.dll
    C:\WINDOWS\system32\setup.exe
    C:\WINDOWS\system32\setupapi.dll
    C:\Program Files\Windows Media Player\setup_wm.exe
    C:\WINDOWS\system32\sfc_os.dll
    C:\WINDOWS\system32\shdoclc.dll
    C:\WINDOWS\system32\shdocvw.dll
    C:\WINDOWS\system32\shell32.dll
    C:\WINDOWS\system32\shimgvw.dll
    C:\WINDOWS\system32\shlwapi.dll
    C:\WINDOWS\system32\shrpubw.exe
    C:\WINDOWS\system32\shscrap.dll
    C:\WINDOWS\system32\sigverif.exe
    C:\WINDOWS\system32\sndrec32.exe
    C:\WINDOWS\system32\sndvol32.exe
    C:\WINDOWS\system32\sol.exe
    C:\WINDOWS\system32\spider.exe
    C:\WINDOWS\srchasst\srchui.dll
    C:\WINDOWS\system32\srclient.dll
    C:\WINDOWS\system32\srrstr.dll
    C:\WINDOWS\system32\sti.dll
    C:\WINDOWS\system32\stimon.exe
    C:\WINDOWS\system32\sti_ci.dll
    C:\WINDOWS\system32\stobject.dll
    C:\WINDOWS\system32\storprop.dll
    C:\WINDOWS\system32\sxs.dll
    C:\WINDOWS\system32\syncapp.exe
    C:\WINDOWS\system32\syncui.dll
    C:\WINDOWS\system32\sysdm.cpl
    C:\WINDOWS\system32\syskey.exe
    C:\WINDOWS\system32\sysmon.ocx
    C:\WINDOWS\system32\sysocmgr.exe
    C:\WINDOWS\system32\syssetup.dll
    C:\WINDOWS\system32\tapiui.dll
    C:\WINDOWS\system32\taskmgr.exe
    C:\WINDOWS\system32\tcpmonui.dll
    C:\WINDOWS\system32\telephon.cpl
    C:\WINDOWS\system32\telnet.exe
    C:\WINDOWS\system32\themeui.dll
    C:\WINDOWS\system32\timedate.cpl
    C:\WINDOWS\system32\tourstart.exe
    C:\WINDOWS\system32\unimdm.tsp
    C:\WINDOWS\system32\upnpui.dll
    C:\WINDOWS\system32\url.dll
    C:\WINDOWS\system32\en-US\urlmon.dll.mui
    C:\WINDOWS\system32\usbui.dll
    C:\WINDOWS\system32\user32.dll
    C:\WINDOWS\system32\userenv.dll
    C:\WINDOWS\system32\utilman.exe
    C:\WINDOWS\system32\uxtheme.dll
    C:\WINDOWS\system32\verifier.exe
    C:\Program Files\Outlook Express\wab.exe
    C:\Program Files\Common Files\System\wab32.dll
    C:\Program Files\Common Files\System\wab32res.dll
    C:\Program Files\Outlook Express\wabfind.dll
    C:\Program Files\Outlook Express\wabimp.dll
    C:\WINDOWS\system32\wdigest.dll
    C:\WINDOWS\system32\webcheck.dll
    C:\WINDOWS\system32\en-US\webcheck.dll.mui
    C:\WINDOWS\system32\wextract.exe
    C:\WINDOWS\system32\wiaacmgr.exe
    C:\WINDOWS\system32\wiadefui.dll
    C:\WINDOWS\system32\wiashext.dll
    C:\WINDOWS\system32\winbrand.dll
    C:\WINDOWS\system32\winchat.exe
    C:\WINDOWS\system32\wininet.dll
    C:\WINDOWS\system32\en-US\wininet.dll.mui
    C:\WINDOWS\system32\winlogon.exe
    C:\WINDOWS\system32\winmine.exe
    C:\WINDOWS\system32\winntbbu.dll
    C:\WINDOWS\system32\winsrv.dll
    C:\WINDOWS\system32\wintrust.dll
    C:\Program Files\Movie Maker\WMM2RES.dll
    C:\Program Files\Windows Media Player\wmplayer.exe
    C:\WINDOWS\system32\wmploc.dll
    C:\Program Files\Windows Media Player\wmpshare.exe
    C:\Program Files\Windows Media Player\wmsetsdk.exe
    C:\Program Files\Windows NT\Accessories\wordpad.exe
    C:\WINDOWS\system32\wpabaln.exe
    C:\WINDOWS\system32\WpdShext.dll
    C:\WINDOWS\system32\write.exe
    C:\WINDOWS\system32\wscui.cpl
    C:\WINDOWS\system32\wsecedit.dll
    C:\WINDOWS\system32\wuapi.dll
    C:\WINDOWS\system32\wuapi.dll.mui
    C:\WINDOWS\system32\wuauclt.exe
    C:\WINDOWS\system32\wuauclt1.exe
    C:\WINDOWS\system32\wuaucpl.cpl
    C:\WINDOWS\system32\wuaucpl.cpl.mui
    C:\WINDOWS\system32\wuaueng1.dll
    C:\WINDOWS\system32\wucltui.dll
    C:\WINDOWS\system32\wucltui.dll.mui
    C:\WINDOWS\system32\wupdmgr.exe
    C:\WINDOWS\system32\wuweb.dll
    C:\WINDOWS\system32\xpsp1res.dll
    C:\WINDOWS\system32\xpsp2res.dll
    C:\WINDOWS\system32\xpsp3res.dll
    C:\WINDOWS\system32\zipfldr.dll
    C:\WINDOWS\Resources\Themes\Luna\luna.msstyles
    C:\WINDOWS\Resources\Themes\Luna\Shell\NormalColor\shellstyle.dll


    2. HardwareIDs: nhiệm vụ chính trích xuất, loại bỏ các HardwareIDs (ACPI, PCI, PCMCIA, PNP, CPQ, Monitor) trùng từ các file inf, thêm HardwareIDs phục vụ cho sysprep

    Cấu trúc: gồm 1 file và 1 folder nằm chung cùng thư mục
    + Driver: thư mục chứa driver (.inf, .sys, .dll) bảo gồm subfolder
    + HardwareIDs.bat: kịch bản tự động thực hiện nhiệm vụ trên

    HardwareIDs.bat
    Show Spoiler
    Mã:
    @echo off
    cls
    setlocal enableextensions enabledelayedexpansion
    
    :: in danh sach file inf
    dir /b /s "driver\*.inf">>list.txt
    
    :: in danh sach HardwareIDs
    for /f "tokens=*" %%i in (list.txt) do (echo %%~ni%%~xi
    call :extract "%%i")
    del list.txt
    
    :: sap xep danh sach HardwareIDs
    ren sysprep.txt temp.txt
    sort /r <temp.txt 1>sysprep.txt
    del temp.txt
    
    :: xoa HardwareIDs trung lap
    ren sysprep.txt temp.txt
    for /f "tokens=1* delims==" %%i in (temp.txt) do (
    if not [%%i]==[!duplicate!] (
    set "duplicate=%%i"
    echo %%i=%%j>>sysprep.txt
    )
    )
    del temp.txt
    
    :: sap xep danh sach HardwareIDs
    ren sysprep.txt temp.txt
    sort <temp.txt 1>sysprep.txt
    del temp.txt
    
    setlocal disableextensions disabledelayedexpansion
    pause
    
    :extract
    for /f "tokens=2 delims=,;" %%f in ('find "ACPI\" %1') do (
    set HardwareIDs=%%f
    set HardwareIDs=!HardwareIDs: =!
    set HardwareIDs=!HardwareIDs:    =!
    echo HardwareIDs,!HardwareIDs!=%1>>temp.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "PCI\" %1') do (
    set HardwareIDs=%%f
    set HardwareIDs=!HardwareIDs: =!
    set HardwareIDs=!HardwareIDs:    =!
    echo HardwareIDs,!HardwareIDs!=%1>>temp.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "PCMCIA\" %1') do (
    set HardwareIDs=%%f
    set HardwareIDs=!HardwareIDs: =!
    set HardwareIDs=!HardwareIDs:    =!
    echo HardwareIDs,!HardwareIDs!=%1>>temp.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "*PNP" %1') do (
    set HardwareIDs=%%f
    set HardwareIDs=!HardwareIDs: =!
    set HardwareIDs=!HardwareIDs:    =!
    echo HardwareIDs,!HardwareIDs!=%1>>temp.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "*CPQ" %1') do (
    set HardwareIDs=%%f
    set HardwareIDs=!HardwareIDs: =!
    set HardwareIDs=!HardwareIDs:    =!
    echo HardwareIDs,!HardwareIDs!=%1>>temp.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "Monitor\" %1') do (
    set HardwareIDs=%%f
    set HardwareIDs=!HardwareIDs: =!
    set HardwareIDs=!HardwareIDs:    =!
    echo HardwareIDs,!HardwareIDs!=%1>>temp.txt
    )
    if exist temp.txt (
    for /f "tokens=2 delims=,;" %%f in ('find "ACPI\" "temp.txt"') do (
    set HardwareIDs=%%f
    echo !HardwareIDs!>>sysprep.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "PCI\" "temp.txt"') do (
    set HardwareIDs=%%f
    echo !HardwareIDs!>>sysprep.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "PCMCIA\" "temp.txt"') do (
    set HardwareIDs=%%f
    echo !HardwareIDs!>>sysprep.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "*PNP" "temp.txt"') do (
    set HardwareIDs=%%f
    echo !HardwareIDs!>>sysprep.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "*CPQ" "temp.txt"') do (
    set HardwareIDs=%%f
    echo !HardwareIDs!>>sysprep.txt
    )
    for /f "tokens=2 delims=,;" %%f in ('find "Monitor\" "temp.txt"') do (
    set HardwareIDs=%%f
    echo !HardwareIDs!>>sysprep.txt
    )
    del temp.txt
    )


    3. Download:

    Xin vui lòng đăng nhập hoặc đăng ký để xem liên kết

    Xin vui lòng đăng nhập hoặc đăng ký để xem liên kết
     
    Last edited: 23 Tháng mười một 2014

Chia sẻ trang này