Re: Simple batch files for integrating updates and drivers in Win7

What is the environment the batch is run in?  Why not just use %systemdrive% or %windir% or %systemroot% and skip the whole drive-scan?  %systemdrive% will return the drive letter (K:\) of the OS you're running in and the others will return "K:\Windows".

Thanks mr_smartepants. I added a card reader and the it added new drive letters to my computer. Since the drive letters are empty, they returned a "No Disk' error which is now fixed with this

@echo off
For %%I in (C D E F G H I J K L M N O P Q R S T U V W X Y Z A B) do (dir %%I:\ 1>nul 2>nul && if /i exist %%I:\Windows set Pagefile=%%I:&goto ok)
goto notfound

:ok
SetPageFile.exe %pagefile%\pagefile.sys 1024
goto end

:notfound
echo pagefile not found

:end

pause

Oh by the way, the reason I do a scan is because I use MiniXP  allot and sometimes the systemdrive I need to scan is E or D and I have seen F one time. The driver letters on MiniXP never match the drive letters on my computer

Last edited by laddanator (2011-11-15 01:20:00)

Re: Simple batch files for integrating updates and drivers in Win7

Ah, OK.  You didn't mention that little tidbit. wink

Oh, and I updated the first post with some experimental code I'm working on.  Tasty stuff! wink

Read BEFORE you post.  HWID tool   DriverPacks Tutorial   DONATE!
http://driverpacks.net/userbar/admin-1.png
Not all heroes wear capes, some wear Kevlar!

Re: Simple batch files for integrating updates and drivers in Win7

mr_smartepants wrote:

Ah, OK.  You didn't mention that little tidbit. wink

Sorry, I get carried away sometimes! smile

Re: Simple batch files for integrating updates and drivers in Win7

Anyone know why I can run DISM from a .cmd from a Windows 7 machine and I get DISM is not an internal command error but if I define the path C:\Windows\System32\Dism.exe works fine?

Re: Simple batch files for integrating updates and drivers in Win7

Type "path" to see the current path. make sure system32 is in the path?

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: Simple batch files for integrating updates and drivers in Win7

Good Evening Sir,

Sir,
I am using driverpacks since about 2.5-3 years and member of DriverPacks.net. I had a deep wish to contribute to driverpacks donation but not able to contribute because of some personal reasons. I decided to contribute some other way and here it is.

I have gone through all your forums containing integrating drivers into the Windows 7 Images and learnt too many new things about dism and got inspired. Especially Mr Smartepants and Mr Overflow. They both are very inspiring.
I have also created a small bunch of scripts that can also be useful to integrate drivers into windows 7 images.
Currently i have created the script bunch only for Windows 7 Ultimate x86 but go further in near future.


i have uploaded my bunch of script as a exe file on below link :

http://www.crocko.com/FBF453400DDC41C18 … MyDISM.exe

You need unpacked driverpacks and source of windows 7 extracted in two different folders.

Last edited by Tarak Bhavsar (2011-12-10 02:01:39)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

Here is the edited file for Windows 7 Ultimate, Professional, Home Premium, Home Basic and Starter (x86). In this one we can choose the folder in which the driverPacks compressed 7z files are located. Script will extract all DriverPacks onto SystemDrive and then inject into the WIM file.

http://www.mediafire.com/?9hyfnn7k73eut3o

Last edited by Tarak Bhavsar (2011-12-11 15:53:11)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

Here is a another bunch of scripts and applications that can unpack driverpacks, inject them into the windows 7 source and then offers you to make a bootable iso image of windows 7.


http://www.mediafire.com/?5cc1e5esh9gqpb1  --64 bit Support--

http://www.mediafire.com/?zesbv0u995nx5k0 -- New -- ISO naming error solved

http://www.mediafire.com/?7w1av1nw8yzqzlj

Last edited by Tarak Bhavsar (2011-12-17 14:42:21)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

Symantec is complaining your .exe is a virus.  Can you post the source code using [ code ] tags?

Read BEFORE you post.  HWID tool   DriverPacks Tutorial   DONATE!
http://driverpacks.net/userbar/admin-1.png
Not all heroes wear capes, some wear Kevlar!

Re: Simple batch files for integrating updates and drivers in Win7

Erik, in order to ensure it's not just a false-positive of your one AV application, I advise you to check suspicious programmes using multiple AV scanners such as provided by https://www.virustotal.com/ and http://virusscan.jotti.org/en
That said, providing the code is still the best measure to avoid any wrong accusations, of course.

Re: Simple batch files for integrating updates and drivers in Win7

Using the batch files in Post #1, do the driver packs have to be unzipped in their respected locations or do you leave them zipped while integrating?

Also do you need another utility besides the WAIK ?

Thanks in advance you guys are doing a great job. I have been out of the scene since Windows XP and am just trying to get back into it.

Re: Simple batch files for integrating updates and drivers in Win7

The drivers need to be decompressed into their respective folders.
The only portion of WAIK that is needed is DISM.

WAIK 3.0: http://www.microsoft.com/download/en/de … px?id=5753
WAIK 3.1 supplement: http://www.microsoft.com/download/en/de … px?id=5188

Read BEFORE you post.  HWID tool   DriverPacks Tutorial   DONATE!
http://driverpacks.net/userbar/admin-1.png
Not all heroes wear capes, some wear Kevlar!

Re: Simple batch files for integrating updates and drivers in Win7

mr_smartepants wrote:

Symantec is complaining your .exe is a virus.  Can you post the source code using [ code ] tags?

sorry brother for the late response. Here is the code of the main script.

::SCRIPT CREATED BY TARAK BHAVSAR
ECHO OFF
color 2f
cls
Title Script for injecting DriverPacks into Windows 7 Source (x86 = 32bit)
set drv_path="%systemdrive%\x86"
echo This script works only for Windows 7 32 bit versions only.
pause
md %temp%\mnt\mountboot
md %temp%\mnt\mountinstall
set mnt_boot="%temp%\mnt\Mountboot"
set mnt_install="%temp%\mnt\Mountinstall"
:: OPERATING SYSTEM SELECTION
:SEL_W7OS
CLS
echo SELECT YOUR OPERATING SYSTEM. PRESS ANY NUMBER AND PRESS ENTER.
echo ================================================================

ECHO Type 1 for Windows 7 Ultimate and Press Enter
ECHO Type 2 for Windows 7 Professional and Press Enter
ECHO Type 3 for Windows 7 Home Premium and Press Enter
ECHO Type 4 for Windows 7 Home Basic and Press Enter
ECHO Type 5 for Windows 7 Starter and Press Enter
ECHO Type 6 to exit.
ECHO.
ECHO In capital letters only.
echo.
ECHO TYPE THE NUMBER AND PRESS ENTER : & ECHO. & SET /p sel_os=

CLS

if %sel_os%==1 (
set Act_OS="Windows 7 ULTIMATE"
) ELSE (
if %sel_os%==2 (
set Act_OS="Windows 7 PROFESSIONAL"
) ELSE (
if %sel_os%==3 (
set Act_OS="Windows 7 HOMEPREMIUM"
) ELSE (
if %sel_os%==4 (
set Act_OS="Windows 7 HOMEBASIC"
) ELSE (
if %sel_os%==5 (
set Act_OS="Windows 7 STARTER"
) ELSE (
IF %sel_os%==6 (
EXIT
) ELSE (
CLS
ECHO INVALID NUMBER PUNCHED. TRY AGAIN.
PAUSE
GOTO SEL_W7OS
))))))

::SELECT PATH TO THE WIM FILES. BOTH SHOULDBE IN ONE FOLDER.

:OS_CHOSEN
ECHO YOU HAVE SELECTED %Act_OS%
ECHO ==========================================================
echo Browse to the setup folder of %Act_OS%.
set inst_pt =
IF EXIST SelectImagePath.vbs (
  FOR /F "tokens=*" %%A IN ('CSCRIPT.EXE //NoLogo SelectImagePath.vbs') DO SET inst_pt=%%A
) ELSE (
  ECHO  e.g if you have D:\Win7SOURCE\I386 type D:\Win7SOURCE
 )
if %inst_pt%=="" goto LEAVE

::IF FILES ARE NOT EXIST SCRIPT WILL PUT YOU IN LOOP UNTILL YOU CHOOSE THE PROPER WIM FOLDER.
::TO EXIT JUST PRESS THE CANCEL BUTTON OF THE DOS WINDOW.


cls
IF not exist %inst_pt%\sources\install.wim (
echo This is not a valid selection. & echo Install.wim file is not present in this folder
PAUSE
CLS & goto OS_CHOSEN
) ELSE (
if not exist %inst_pt%\sources\boot.wim (
echo This is not a valid selection. & echo Boot.wim file is not present in this folder
PAUSE
CLS & goto OS_CHOSEN
))

cls


:: SELECT PATH TO THE DRIVERPACKS FOLDER IN WHICH THE 7ZIPPED COMPRESSED DRIVER PACKS ARE LOCATED.

echo Select the DriverPacks folder.
set drv_pt =
IF EXIST SelectDriversPath.vbs (
  FOR /F "tokens=*" %%A IN ('CSCRIPT.EXE //NoLogo SelectDriversPath.vbs') DO SET drv_pt=%%A
) ELSE (
  ECHO  e.g if you have D:\Win7SOURCE\I386 type D:\Win7SOURCE
 )
IF "%drv_pt%"=="" goto END_ERROR

if exist %drv_pt%\DP*.7z (
cls
echo Extracting DriverPacks. Please wait.
Start /wait /separate /high "" "un7zip.exe" "%drv_pt%\DP*.7z" %SystemDrive%\
) ELSE (
ECHO No DriverPacks Found. Aborting the process.
pause
goto END_ERROR
)

cls

:: INSTALL.WIM IMAGE WILL MOUNT.

echo Mounting INSTALL.WIM file.
Dism /Mount-Wim /WimFile:"%inst_pt%\sources\install.wim" /Name:%Act_OS% /MountDir:%mnt_install%
echo.

::EXTRACTED DRIVERPACKS WILL BE INJECTED INTO INSTALL.WIM IMAGE.

cls
echo Injecting Drivers into %Act_OS% install Image Please Wait.....
echo.
Dism /image:%mnt_install% /Add-Driver /driver:%drv_path% /recurse /ForceUnsigned
echo.
cls

::INSTALL.WIM FILL WILL BE UNMOUNTED AND SAVED.

echo Unmounting And Saving Changes To %Act_OS% install Image Please Wait.....
echo.
Dism /Unmount-Wim /MountDir:%mnt_install% /commit
echo.
cls

::BOOT.WIM WILL BE MOUNTED.

echo Mounting BOOT.WIM.
Dism /Mount-Wim /WimFile:%inst_pt%\sources\BOOT.WIM /index:2 /MountDir:%mnt_boot%
echo.
cls

::MASS STORAGE DRIVERS WILL BE INJECTED INTO THE BOOT.WIM IMAGE.

echo Adding Drivers To Boot.wim
echo.
Dism /image:%mnt_boot% /Add-Driver /driver:%drv_path%\M /recurse /ForceUnsigned
echo.

::BOOT.WIM IMAGE WILL BE UNMOUNTED AND SAVED.
cls
echo Unmounting Boot.wim
echo.
Dism /Unmount-Wim /MountDir:%mnt_boot% /commit
echo.


CLS
echo Process completed successfully.
pause

echo Do you wan to create an bootable ISO ?
echo.
set /p  askiso=
if %askiso%==y (
goto MAKEISO
) ELSE (
goto LEAVE
)
:MAKEISO
cls
echo Name of ISO ? (Without Space)
echo.
set /p iso_name=
cls
echo Where to save ISO File ? Select folder.
set iso_dest=
IF EXIST SaveISOPath.vbs (
  FOR /F "tokens=*" %%A IN ('CSCRIPT.EXE //NoLogo SaveISOPath.vbs') DO SET iso_dest=%%A
) ELSE (
  ECHO  e.g if you have D:\Win7SOURCE\I386 type D:\Win7SOURCE
 )
if %iso_dest%=="" goto LEAVE
move bootable.iso %iso_dest%\
ren %iso_dest%\bootable.iso %iso_name%.iso
cls
echo Making ISO Image
start /wait ultraiso -in %iso_dest%\%iso_name%.iso -d %inst_pt%
GOTO LEAVE


:END_ERROR
CLS
ECHO Process couldn't completed successfully.
pause
:LEAVE
cls
ECHO Cleaning up. Please wait ........
::REMOVE EXTRACTED DRIVERS
rd %systemdrive%\x86 /S /Q
rd %temp%\mnt /S /Q


EXIT

Last edited by Tarak Bhavsar (2012-05-19 17:01:47)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

coxswain_bh wrote:

Using the batch files in Post #1, do the driver packs have to be unzipped in their respected locations or do you leave them zipped while integrating?

use a new bunch of scripts as exe. download from below link


Download newdism6.2.exe




coxswain_bh wrote:

Also do you need another utility besides the WAIK ?

No other utility is needed.

Last edited by Tarak Bhavsar (2012-05-18 01:46:43)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

I have uploaded a video of tutorial how to use dism tool i have mentioned in previous post and what precautions shoud be taken @

Video Tutorial

Last edited by Tarak Bhavsar (2012-05-19 16:35:10)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

mr_smartepants wrote:

Symantec is complaining your .exe is a virus.  Can you post the source code using [ code ] tags?

http://i.imgur.com/aIsL3.jpg

Last edited by Tarak Bhavsar (2012-05-19 17:01:04)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

I have uploaded a new bunch of scripts which supports our new structure of our new DP*12*.7z extracted structure and will integrate updates too into the Windows 7 Setup.


Download newdism7.1.exe

Note : Currently x86=32bit support only.

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

You know, you could just start your own thread instead of hijacking mine. wink
I'll move your posts over once you create the topic.

Read BEFORE you post.  HWID tool   DriverPacks Tutorial   DONATE!
http://driverpacks.net/userbar/admin-1.png
Not all heroes wear capes, some wear Kevlar!

Re: Simple batch files for integrating updates and drivers in Win7

Ok. Sir, i apologize for the same.

Thanks for the smart suggestion. I will immediately start a new topic.

Last edited by Tarak Bhavsar (2012-06-09 00:45:08)

An eye for an eye will make the whole world blind. - Mahatma Gandhi (Mohandas Karamchand Gandhi)

Re: Simple batch files for integrating updates and drivers in Win7

Hello all,

The Updates batch  tool works great for Seven 64 bit. It mounts, integrates patchs and then unmount install.wim. No problem ...

BUT ... it only occurs for index:4. Not the other index. DISM reports integration might be successfull anyway.

Is this normal ?

Thanks.

EDIT : It seems the index matchs to the differents Windows versions ... so this is normal that works for only one index. Can you confirme please ?

EDIT2 : OK found the confirmation. I updated the BATCH files. Eveything is OK now. Ne error at all.

Last edited by Lucius Snow (2012-08-02 09:58:55)

Re: Simple batch files for integrating updates and drivers in Win7

Tnx for your scripts, mr_smartepants!
A question: how should arranged folders of driverpacks in "C:\Tools\Drivers\x64"?
Example for DP_WLAN_wnt6-x64_1203.7zip
If I extract it, I got a "x64" folder and inside: /All /Vista /Win7/ and WLAN_x64.txt file.
For a Win7 64bit integration I need only "/Win7" folder, right?
Inside this folder there is a "W" folder with inside: /Atheros /Intel /Ralink...
Correct disposal is:
C:\Tools\Drivers\x64\W\Atheros
C:\Tools\Drivers\x64\W\Intel
C:\Tools\Drivers\x64\W\Ralink
...
or
C:\Tools\Drivers\x64\Atheros
C:\Tools\Drivers\x64\Intel
C:\Tools\Drivers\x64\Ralink
or what?

Re: Simple batch files for integrating updates and drivers in Win7

It doesn't matter as long as all the drivers are inside the \x64 folder.
For Win7 installations you should keep the "All" folder as well as the "Win7" folder.  It's safe to delete the "Vista" and "Server" folders but will cause no problems if you leave them.

Read BEFORE you post.  HWID tool   DriverPacks Tutorial   DONATE!
http://driverpacks.net/userbar/admin-1.png
Not all heroes wear capes, some wear Kevlar!

Re: Simple batch files for integrating updates and drivers in Win7

Hello

Do you  see anything wrong in these commands below? I can mount - unmount image but I cannot integrate in boot.wim masstorage driverpacks... I get error that each driver didn't install successfully...

@echo off

Dism /Mount-Wim /WimFile:E:\el_windows_7_sp1_x86\sources\BOOT.WIM /index:1 /MountDir:C:\mount
Dism /Add-Driver /image:C:\mount /driver:E:\M /recurse
dism /Unmount-Wim /MountDir:C:\mount /commit

Re: Simple batch files for integrating updates and drivers in Win7

Is Drive:E a hard drive or DVD?
The command to inject drivers has the /image flag in the wrong place.
Example: Dism /image:%mount% /Add-Driver /driver:%drivers% /recurse

So you second line sould look like this:
Dism /image:C:\mount /Add-Driver /driver:E:\M /recurse

Read BEFORE you post.  HWID tool   DriverPacks Tutorial   DONATE!
http://driverpacks.net/userbar/admin-1.png
Not all heroes wear capes, some wear Kevlar!

Re: Simple batch files for integrating updates and drivers in Win7

It is hard drive. I tested again as you suggested but the same happens.