Mister X, You would need to add the driver to every index in both boot.wim & install.wim. If you look at the notes/sample from the other forum you'll see he is using the same dism /add-driver command. A standard win7 32bit would have index 1 as Starter, 2 = Home Basic, 3 Home Premium, 4 Pro, 5 Ultimate. Boot.wim has 2. Your AIO is probably different. Go back to the 1st page in this thread & re-read. Murphy78 has many samples for you to learn from. Code: REM Windows 7 x86 WinPE DISM /Mount-Wim /WimFile:C:\Win7_x86\DVD\sources\boot.wim /index:1 /MountDir:C:\Win7_x86\Mount DISM /image:C:\Win7_x86\Mount /Add-Driver /driver:C:\Win7_x86\Drivers.32\USB3 /recurse /forceunsigned DISM /Unmount-Wim /MountDir:C:\Win7_x86\Mount /Commit REM Windows 7 x86 Setup DISM /Mount-Wim /WimFile:C:\Win7_x86\DVD\sources\boot.wim /index:2 /MountDir:C:\Win7_x86\Mount DISM /image:C:\Win7_x86\Mount /Add-Driver /driver:C:\Win7_x86\Drivers.32\USB3 /recurse /forceunsigned DISM /Unmount-Wim /MountDir:C:\Win7_x86\Mount /Commit
Since I deal with OEM sw this frustrated me for weeks until I found the article. I tried to get help from MS to find a solution & they were useless. I couldn't believe MS would restrict in this way. It doesn't make sense! I think it was someone here that suggested firstlogon which still works. Hopefully they don't get rid of that too.
That was a simple and elegant solution. Just rename the setupcomplete.cmd to firstlogon.cmd and add the parts to your unattend.xml that flipp3r mentioned. Or just change the unattend.xml to run setupcomplete.cmd during the firstlogon pass.
Well the 1st user is always going to be admin so it always runs. My firstlogon does some low level stuff that needs to be admin & I've never had an issue.
Commands ran by the system with runonce or run commands always have System(R) permissions. Given that they're ran with the same method, I'd gather that it's likely that unattend's firstlogon commands function the same as a normal runonce registry key command. You can test this by aiming the firstlogon phase at setupcomplete from my $oem$ folder and if it sets the defender exclusion, you have system permissions. Anything less than "NT Authority\System" or TrustedInstaller permissions and it won't be able to set the exclusion.
Is there any way to remove the space at the start and at the end of the index name and description. i.e " Windows 8.1 Pro "
As you ask, i found a slightly better way . Code: for /f "tokens=2 delims=: " %%a in ('DISM /Get-WimInfo /WimFile:"%path2%" ^| findstr /i Index') do ( for /f "tokens=2,* delims=: " %%g in ('DISM /Get-WimInfo /WimFile:"%path2%" /Index:%%a ^| findstr /i Name') do ( echo %%a. %%g %%h ) ) Now the Name string is without spaces .
I figured out how to put 2 spaces on each side instead of one... Does that count? Code: for /f "tokens=2 delims=: " %%a in ('DISM /Get-WimInfo /WimFile:"H:\Sources\install.wim" ^| find /i "Index"') do ( for /f "tokens=2 delims=:" %%g in ('DISM /Get-WimInfo /WimFile:"H:\Sources\install.wim" /Index:%%a ^| find /i "Name"') do ( echo.%%a. %%g >>C:\temp\wiminfo.txt ) ) Should we not be adding like a Code: Set OUTECHO=%%a.%%g echo %OUTECHO% or something?
Writing to temp file would be a way, as trying to set value to variable inside the loop will only show last one, at loops end .