[SOLVED] ~ OEM BRANDING HELP ~

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

[SOLVED] ~ OEM BRANDING HELP ~

#1 Post by Dos_Probie » 27 Aug 2012 05:05

Thanks everyone for the script help, Everything is Working on My OEM and Custom Branding now! .. Dos_Probie :mrgreen:



This is a snippet of code of the OEM Branding that I have been using successfully for setting up W7 on first run,
I Now have about 20 office computers to build for a small business and thought I would brand with the specific company logo etc.
I added Custom to my oem list and have not tested this out as of yet, but if any gurus have a better way I am Open..

Thanx, Probie 8)

Code: Select all

@echo off
::
:: SILENT OEM BRANDING FOR WINDOWS 7
::
:: Work off USB Root
for %%i in (d e f g h i j k l m n o p q r s) do if exist %%i:\sources\install.wim set usb=%%i:
::
:: Set Variable Parameters
set manf=wmic computersystem get manufacturer
set oem=if not errorlevel 1
set custom=if errorlevel 1
set copy=xcopy /cqhysei
set reg=regedit /s
set cmd=cmd /c
::
:: Minimize
min.exe
::
::Check
IF EXIST "wmic computersystem get manufacturer" GOTO :OEM
IF NOT EXIST "wmic computersystem get manufacturer" GOTO :CUSTOM
::
:OEM
::
%manf% | findstr /i "ACER">nul
%oem% set man=ACER&goto :ACER
::
%manf% | findstr /i "COMPAQ">nul
%oem% set man=COMPAQ&goto :COMPAQ
::
%manf% | findstr /I "DELL">nul
%oem% set man=DELL&goto :DELL
::
:ACER
::
%reg% %usb%\wpi\copy\oem\ACER\ACER.reg
%cmd% %copy% %usb%\wpi\copy\oem\ACER\WALLPAPER.jpg %windir%\web\wallpaper
%cmd% %copy% %usb%\wpi\copy\oem\ACER\ACER.theme %windir%\resources\themes
%cmd% %copy% %usb%\wpi\copy\oem\ACER\ACER_BADGE.bmp %windir%\system32\oobe\info
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\ACER.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :END
::
:CUSTOM
%reg% %usb%\wpi\copy\oem\DEFAULT\Default.reg
%cmd% %copy% %usb%\wpi\copy\oem\DEFAULT\WALLPAPER.jpg %windir%\web\wallpaper
%cmd% %copy% %usb%\wpi\copy\oem\DEFAULT\DEFAULT.theme %windir%\resources\themes
%cmd% %copy% %usb%\wpi\copy\oem\DEFAULT\DEFAULT_BADGE.bmp %windir%\system32\oobe\info
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\Default.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
GOTO :END
::
:END
::
Exit
Last edited by Dos_Probie on 03 Sep 2012 10:14, edited 1 time in total.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: ~ OEM BRANDING HELP ~

#2 Post by Dos_Probie » 27 Aug 2012 12:35

This concept has been around for a long time and both the Microsoft TechNet site and MSFN forum have plenty of info on OEM Branding as well..

Basically what it Does is save you Lots of Time and Labor if you do frequent re-installs on different OEM Windows 7 machines,
such as Acer, Dell, HP, Gateway, Toshiba etc.
The Script will automatically install the Orginal OEM Files for: Wallpaper,Logon Background,System Property Badge,User Pic,Theme as well
as the default OEM webpage all back to orginal factory defaults.. I have been doing this successfully the past 4-5 years but now
I have the need to include Custom branding on Non-Oem machines (custom built) and that's where I am at now.. I would like
to make sure my If Exsist and If Not Exsist statements would work or do I need to include an errorlevel so when the script
reads the bios and cannot find an OEM then it will install my Custom branding..

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: ~ OEM BRANDING HELP ~

#3 Post by abc0502 » 27 Aug 2012 16:56

Is this the original code or you modified it, i see missing labels and functions

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: ~ OEM BRANDING HELP ~

#4 Post by Dos_Probie » 27 Aug 2012 17:56

This is a snippet of code of the OEM Branding that I have been using successfully


As i posted this is just a portion of my code, but if would help I will
be glad to post the entire file.. 8)

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: ~ OEM BRANDING HELP ~

#5 Post by abc0502 » 27 Aug 2012 18:11

sorry, i don't know how i missed that :oops:

from what i understood from this part, when you want to add a new brand

you will add this part in the OEM section
%manf% | findstr /i "XXXX">nul
%oem% set man=XXXX&goto :XXXX

and change the red x with the brand name

Then, make a label with tha name like this and add it after the last brand you have, so it should look like this
:XXXX
::
%reg% %usb%\wpi\copy\oem\XXXX\XXXX.reg
%cmd% %copy% %usb%\wpi\copy\oem\XXXX\WALLPAPER.jpg %windir%\web\wallpaper
%cmd% %copy% %usb%\wpi\copy\oem\XXXX\XXXX.theme %windir%\resources\themes
%cmd% %copy% %usb%\wpi\copy\oem\XXXX\XXXX_BADGE.bmp %windir%\system32\oobe\info
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\XXXX.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :END
::


andofcourese you will add a folder in the oem folder on the usb with the same brand name and with thems that hold that name and so is the rest of the files if nessasary, like the files that has the red X

and i think that's all what you need.

i will post a sample of this code after modification in few minutes
Last edited by abc0502 on 27 Aug 2012 18:21, edited 1 time in total.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: ~ OEM BRANDING HELP ~

#6 Post by abc0502 » 27 Aug 2012 18:20

OK here is the sample, i added a new brand called "abc0502" :)
all changes are in red all what you have to change will be the red text=, replace it with your brand name.
@echo off
::
:: SILENT OEM BRANDING FOR WINDOWS 7
::
:: Work off USB Root
for %%i in (d e f g h i j k l m n o p q r s) do if exist %%i:\sources\install.wim set usb=%%i:
::
:: Set Variable Parameters
set manf=wmic computersystem get manufacturer
set oem=if not errorlevel 1
set custom=if errorlevel 1
set copy=xcopy /cqhysei
set reg=regedit /s
set cmd=cmd /c
::
:: Minimize
min.exe
::
::Check
IF EXIST "wmic computersystem get manufacturer" GOTO :OEM
IF NOT EXIST "wmic computersystem get manufacturer" GOTO :CUSTOM
::
:OEM
::
%manf% | findstr /i "ACER">nul
%oem% set man=ACER&goto :ACER
::
%manf% | findstr /i "COMPAQ">nul
%oem% set man=COMPAQ&goto :COMPAQ
::
%manf% | findstr /I "DELL">nul
%oem% set man=DELL&goto :DELL
::===============================================================
%manf% | findstr /I "abc0502">nul
%oem% set man=abc0502&goto :abc0502
::===============================================================
:ACER
::
%reg% %usb%\wpi\copy\oem\ACER\ACER.reg
%cmd% %copy% %usb%\wpi\copy\oem\ACER\WALLPAPER.jpg %windir%\web\wallpaper
%cmd% %copy% %usb%\wpi\copy\oem\ACER\ACER.theme %windir%\resources\themes
%cmd% %copy% %usb%\wpi\copy\oem\ACER\ACER_BADGE.bmp %windir%\system32\oobe\info
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\ACER.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :END
::===============================================================
:abc0502
::
%reg% %usb%\wpi\copy\oem\abc0502\abc0502.reg
%cmd% %copy% %usb%\wpi\copy\oem\abc0502\WALLPAPER.jpg %windir%\web\wallpaper
%cmd% %copy% %usb%\wpi\copy\oem\abc0502\abc0502.theme %windir%\resources\themes
%cmd% %copy% %usb%\wpi\copy\oem\abc0502\abc0502_BADGE.bmp %windir%\system32\oobe\info
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\abc0502.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :END
::===============================================================
:CUSTOM
%reg% %usb%\wpi\copy\oem\DEFAULT\Default.reg
%cmd% %copy% %usb%\wpi\copy\oem\DEFAULT\WALLPAPER.jpg %windir%\web\wallpaper
%cmd% %copy% %usb%\wpi\copy\oem\DEFAULT\DEFAULT.theme %windir%\resources\themes
%cmd% %copy% %usb%\wpi\copy\oem\DEFAULT\DEFAULT_BADGE.bmp %windir%\system32\oobe\info
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\Default.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
GOTO :END
::
:END
::

purple "abc0502" are the folder in the USB and the red are the files names in that folders

All the code that i added is between the equal signs

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: ~ OEM BRANDING HELP ~

#7 Post by Dos_Probie » 27 Aug 2012 19:31

abc.. Thanks for the suggestions,I understand how to add more OEM's but want I am wanting to do is to make sure the ::Check label will
either goto my listed OEM from the wmic command and then if wmic cannot find any OEM will then do a goto else of my Custom branding from the Custom
folder. hope this clears this up some ...

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: ~ OEM BRANDING HELP ~

#8 Post by Squashman » 27 Aug 2012 19:43

Code: Select all

::Check 
IF EXIST "wmic computersystem get manufacturer" GOTO :OEM
IF NOT EXIST "wmic computersystem get manufacturer" GOTO :CUSTOM

Well if you actually ran and tested your code for that you will see that it doesn't work. IF EXIST does not work with the output of a command. You need to put the WMIC command into a FOR LOOP and parse the output.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: ~ OEM BRANDING HELP ~

#9 Post by Squashman » 27 Aug 2012 19:59

How about you do something like this instead.

Code: Select all

@echo off

for %%G IN (ACER COMPAQ DELL) do (
   wmic computersystem get manufacturer |findstr /i "%%G">nul &&set man=%%G &&goto :%%G
)

goto :custom

:ACER
echo. Its an %man%
Pause
goto :EOF

:custom
echo. OEM default
pause
goto :EOF

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: ~ OEM BRANDING HELP ~

#10 Post by Dos_Probie » 28 Aug 2012 18:42

OK, After a lot of trial and error I adjusted my previous code and now have everything working!

1.Scans bios for OEM Manufacturer.
2.Sets discovered OEM to variable Label.
3.Then runs branding code (I used a echo to text to test in lieu of orginal branding code in this example.)
4.If none of the listed OEM's are found in bios will skip to Custom Branding then install custom files and exit when done.

"If at first you don't succeed your about average" .. 8)

Code: Select all

@echo off
mode con: cols=75 lines=20
color 1e
cd %~dp0
:: AUTO UNATTENDED OEM BRANDING FOR WINDOWS 7
::
:: WMI Bios Query to get OEM Info To Variable
FOR /F "tokens=2 delims==- " %%A IN ('"wmic bios get Manufacturer /format:list"') DO SET OEM=%%A
::
:: OEM Labels
IF %oem%==ACER set man=ACER&goto :ACER Branding
IF %oem%==ASUS set man=ASUS&goto :ASUS Branding
IF %oem%==COMPAQ set man=COMPAQ&goto :COMPAQ Branding
IF %oem%==DELL set man=DELL&goto :DELL Branding
IF %oem%==EMACHINE set man=EMACHINE&goto :EMACHINE Branding
IF %oem%==GATEWAY set man=GATEWAY&goto :GATEWAY Branding
IF %oem%==Hewlett-Packard set man=Hewlett-Packard&goto :Hewlett-Packard Branding
IF %oem%==LENOVA set man=LENOVA&goto :LENOVA Branding
IF %oem%==SAMSUNG set man=SAMSUNGA&goto :SAMSUNG Branding
IF %oem%==SONY set man=SONYA&goto :SONY Branding
IF %oem%==TOSHIBA set man=TOSHIBA&goto :TOSHIBA Branding
::
:: Run Branding Code for Specific OEM
:ACER Branding
echo>>%~dp0\ACER.txt ACER OEM
goto :end
::
:ASUS Branding
echo>>%~dp0\ASUS.txt ASUS OEM
goto :end
::
:COMPAQ Branding
echo>>%~dp0\COMPAQ.txt COMPAQ OEM
goto :end
::
:DELL Branding
echo>>%~dp0\DELL.txt Dell OEM
goto :end
::
:EMACHINE Branding
echo>>%~dp0\EMACHINE.txt EMACHINE OEM
goto :end
::
:GATEWAY Branding
echo>>%~dp0\GATEWAY.txt GATEWAY OEM
goto :end
::
:Hewlett-Packard Branding
echo>>%~dp0\Hewlett-Packard.txt Hewlett-Packard OEM
goto :end
::
:LENOVA Branding
echo>>%~dp0\LENOVA.txt LENOVA OEM
goto :end
::
:SAMSUNG Branding
echo>>%~dp0\SAMSUNG.txt SAMSUNG OEM
goto :end
::
:SONY Branding
echo>>%~dp0\SONY.txt SONY OEM
goto :end
::
:TOSHIBA Branding
echo>>%~dp0\TOSHIBA.txt TOSHIBA OEM
::
goto :end
::CUSTOM Branding
echo>>%~dp0\Custom.txt Custon Non-OEM
goto :end
::
:End
::
Exit

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: ~ OEM BRANDING HELP ~

#11 Post by Squashman » 28 Aug 2012 19:27

A lot of redundant code their Dos_Probie. I thought you were looking for a more stream lined code base which is what I provided.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: ~ OEM BRANDING HELP ~

#12 Post by Dos_Probie » 30 Aug 2012 14:39

Squash..Thanks for the code! Clever idea how you added wmic with oems in For loop statement with goto..I revised my posted code and have tested it on 4 machines (Acer, HP, Dell and Toshiba) and all worked with flying colors.. :P

Code: Select all

@echo off
mode con: cols=75 lines=20
color 1e

:: AUTO UNATTENDED OEM BRANDING FOR WINDOWS 7

:: Copy from Root of USB
for %%i in (d e f g h i j k l m n o p q r s) do if exist %%i:\sources\install.wim set usb=%%i:
::
:: Set Variable Parameters
set copy=xcopy /cqhysei
set reg=regedit /s
set cmd=cmd /c

:: WMI OEM BIOS QUERY TO VARIABLE then Goto - (Add more OEMs as needed. Credit:Squashman/Dostips)
for %%a in (ACER DELL HEWLETT-PACKARD TOSHIBA) do (wmic bios get Manufacturer |findstr /i "%%a">nul &&set man=%%a &&goto :%%a)

goto :CUSTOM

:: OEM BRANDING
:ACER
%reg% %usb%\wpi\copy\oem\ACER\ACER.reg
%cmd% %copy% %usb%\wpi\copy\oem\ACER\WALLPAPER.jpg %windir%\web\wallpaper>nul
%cmd% %copy% %usb%\wpi\copy\oem\ACER\ACER.theme %windir%\resources\themes>nul
%cmd% %copy% %usb%\wpi\copy\oem\ACER\ACER_BADGE.bmp %windir%\system32\oobe\info>nul
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\ACER.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :EOF

:DELL
%reg% %usb%\wpi\copy\oem\DELL\DELL.reg
%cmd% %copy% %usb%\wpi\copy\oem\DELL\WALLPAPER.jpg %windir%\web\wallpaper>nul
%cmd% %copy% %usb%\wpi\copy\oem\DELL\DELL.theme %windir%\resources\themes>nul
%cmd% %copy% %usb%\wpi\copy\oem\DELL\DELL_BADGE.bmp %windir%\system32\oobe\info>nul
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\DELL.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :EOF

:Hewlett-Packard
%reg% %usb%\wpi\copy\oem\HP\HP.reg
%cmd% %copy% %usb%\wpi\copy\oem\HP\WALLPAPER.jpg %windir%\web\wallpaper>nul
%cmd% %copy% %usb%\wpi\copy\oem\HP\HP.theme %windir%\resources\themes>nul
%cmd% %copy% %usb%\wpi\copy\oem\HP\HP_BADGE.bmp %windir%\system32\oobe\info>nul
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\HP.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
goto :EOF

:TOSHIBA
%reg% %usb%\wpi\copy\oem\TOSHIBA\Toshiba.reg
%cmd% %copy% %usb%\wpi\copy\oem\TOSHIBA\WALLPAPER.jpg %windir%\web\wallpaper>nul
%cmd% %copy% %usb%\wpi\copy\oem\TOSHIBA\TOSHIBA.theme %windir%\resources\themes>nul
%cmd% %copy% %usb%\wpi\copy\oem\TOSHIBA\TOSHIBA_BADGE.bmp %windir%\system32\oobe\info>nul
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\TOSHIBA.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :EOF

:CUSTOM
%reg% %usb%\wpi\copy\oem\CUSTOM\CUSTOM.reg
%cmd% %copy% %usb%\wpi\copy\oem\CUSTOM\WALLPAPER.jpg %windir%\web\wallpaper>nul
%cmd% %copy% %usb%\wpi\copy\oem\CUSTOM\CUSTOM.theme %windir%\resources\themes>nul
%cmd% %copy% %usb%\wpi\copy\oem\CUSTOM\CUSTOM_BADGE.bmp %windir%\system32\oobe\info>nul
wmic process where name="dllhost.exe" call terminate>nul
:: Set Theme
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\CUSTOM.theme"
:: Refresh Desktop
ping -n 2 127.0.0.1>nul
taskkill /f /im explorer.exe>nul
start explorer.exe>nul
goto :EOF

:EOF
Exit

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: ~ OEM BRANDING HELP ~

#13 Post by Squashman » 30 Aug 2012 16:25

You know you could probably condense all your redundant code. You have a variable with the manufacturer name. Why not use that to your advantage instead of repeating the code for each manufacturer.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: ~ OEM BRANDING HELP ~

#14 Post by Dos_Probie » 30 Aug 2012 17:34

Squash, I know its a work in progress..And I am also doing variable's for theme, refresh ,taskkill and wmic.
But feel free If you have an Example for the %man% variable using my code that would help as well..

And Ed, Thanks for the pm advice! :mrgreen:

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: ~ OEM BRANDING HELP ~

#15 Post by Ed Dyreen » 31 Aug 2012 01:54

'
Hi Dos_Probie,
Squashman wrote:You could probably condense all your redundant code. You have a variable with the manufacturer name. Why not use that to your advantage instead of repeating the code for each manufacturer.
As Squasman said

Code: Select all

@echo off &setlocal enableDelayedExpansion

:: AUTO UNATTENDED OEM BRANDING FOR WINDOWS 7

:§init ( paramRAW )
:: (
       mode con: cols=75 lines=20
       color 1e

       call :§main %* !

       echo.
       echo.You shouldn't add that many nul redirections,
       echo.it hardens your ability to debug the code.
       echo.
       echo.I didn't test it cause some command structures are invalid to my native winXP machine.
       echo.please test it before removing these lines ;^)
       pause
:: )
exit /b 0

:§main ( null )
:: (
       :: Copy from Root of USB

       for %%? in (

              d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s

       ) do   if exist "%%~?:\sources\install.wim" (

              set "$usb.drive=%%~?:"
       )

       :: WMI OEM BIOS QUERY TO VARIABLE then CALL - (Add more OEMs as needed. Credit:Squashman/Dostips)

       set "$manufacturer=custom" &for /f "skip=1 tokens=1" %%? in (

              'wmic.EXE bios get Manufacturer'

       ) do   set "$=%%~?" &for %%? in (

              ACER, DELL, Hewlett-Packard, TOSHIBA,

       ) do   if "!$!" neq "!$:%%~?=!" (

              set "$manufacturer=%%~?"
       )

       :: OEM BRANDING

       regedit /s !$usb.drive!\wpi\copy\oem\!$manufacturer!\!$manufacturer!.REG

       set "$src.fullPath=!$usb.drive!\wpi\copy\oem\!$manufacturer!"
       xcopy /cqhysei "!$src.fullPath!\WALLPAPER.jpg" "%windir%\web\wallpaper"
       xcopy /cqhysei "!$src.fullPath!\!$manufacturer!.THEME" "%windir%\resources\themes"
       xcopy /cqhysei "!$src.fullPath!\!$manufacturer!_BADGE.BMP" "%windir%\system32\oobe\info"

       wmic.EXE process where name="dllhost.exe" call terminate

       ::Set Theme
       rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\!$manufacturer!.THEME"

       :: Refresh Desktop
       >nul 2>&1 ping -n 2 127.0.0.1
       taskkill /f /im explorer.EXE
       start "" "explorer.EXE"
:: )
exit /b 0
The way you use xcopy suggest to me that you are on vista/7, you don't seem to care about XP compatibility. But then you use the ping command, why ? You could just as well have used "timeout /?" as it isn't XP compatible anyways.

Regards,

Post Reply