질문과 답변

윈 도 우 윈도우 7 OEM 폴더 통합 관련 질문...

2017.03.22 19:27

디노야놀자 조회:628

 

 

윈도우 7에 OEM 폴더 통합하려고 하는데요.

구조는 아래와 같습니다.

 

 

첨부 이미지

 

 

SetupComplete.bat 배치 파일 내용은 아래와 같습니다.

 

 


@echo off
pushd %~dp0
set ScriptPath=%~dp0

echo.
echo Please wait...
echo.
echo Initializing installed OS...
echo.
SET RC=%Windir%\System32\reg.exe
IF EXIST %Windir%\Sysnative\reg.exe SET RC=%Windir%\Sysnative\reg.exe
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Ultimate N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:PIRATE
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Ultimate" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:7
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Enterprise N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Enterprise E" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Enterprise" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Professional N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Professional" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:7
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Home Premium N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:PIRATE
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Home Premium" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:7
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Home Basic N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:PIRATE
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Home Basic" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:7
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Starter N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:PIRATE
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Starter" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:7
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Embedded Standard" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:EMBEDDED
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server 2008 R2 Enterprise" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:SERVERR2
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server 2008 R2 Standard" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:SERVERR2
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server 2008 R2 Foundation" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:SERVERR2
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "HPC Edition" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server 2008 R2 Datacenter" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server 2008 R2 Itanium" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Web Server 2008 R2" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Ultimate" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:VISTA
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Enterprise N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Enterprise" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Business N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:VISTA
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Business" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:VISTA
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Home Premium" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:VISTA
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Home Basic N" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:VISTA
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Home Basic" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:VISTA
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Vista (TM) Starter" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:VISTA
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server (R) 2008 Enterprise" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:SERVERR
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server (R) 2008 Standard" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:SERVERR
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server (R) 2008 Foundation" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:SERVERR
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Small Business Server 2008" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:SERVERR
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server (R) 2008 Datacenter" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Server (R) 2008 Itanium" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:KMS
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows Web Server (R) 2008" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:PIRATE
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:PIRATE
%RC% QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "R2" >nul
IF NOT ERRORLEVEL 1 echo Installed OS successfully determined. & echo. & GOTO:PIRATE
GOTO:END

:7
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Windows_7.cmd        call data\Source\Windows_7.cmd
GOTO:END

:EMBEDDED
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Windows_Embedded.cmd call data\Source\Windows_Embedded.cmd
GOTO:END

:PIRATE
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Pirate.cmd           call data\Source\Pirate.cmd
GOTO:END

:SERVERR2
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Windows_ServerR2.cmd call data\Source\Windows_ServerR2.cmd
GOTO:END

:SERVERR
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Windows_ServerR.cmd  call data\Source\Windows_ServerR.cmd
GOTO:END

:VISTA
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Windows_Vista.cmd    call data\Source\Windows_Vista.cmd
GOTO:END

:KMS
if exist data\Source\Shortcut.cmd         call data\Source\Shortcut.cmd
if exist data\Source\WMIPatch.cmd         call data\Source\WMIPatch.cmd
if exist data\Source\Windows_KMS.cmd      call data\Source\Windows_KMS.cmd
GOTO:END

:END
::Check user::
if exist "%Systemdrive%\Users\%username%\Desktop" GOTO:UEND
START /B SHUTDOWN /R /T 5
IF EXIST "%systemroot%\system32\oobe\info\oobe.xml" (
   DEL /F /Q "%systemroot%\system32\oobe\info\oobe.xml"
)

IF EXIST "%systemroot%\system32\oem\*" (
   DEL /F /Q /S "%systemroot%\system32\oem"
   RD /S /Q "%systemroot%\system32\oem"
)

IF EXIST "%systemroot%\setup\scripts\*" (
   DEL /F /Q /S "%systemroot%\setup\scripts"
   RD /S /Q "%systemroot%\setup\scripts"
)
DEL /F /Q %0% >nul

:UEND
IF EXIST "%systemroot%\system32\oobe\info\oobe.xml" (
   DEL /F /Q "%systemroot%\system32\oobe\info\oobe.xml"
)

IF EXIST "%systemroot%\system32\oem\*" (
   DEL /F /Q /S "%systemroot%\system32\oem"
   RD /S /Q "%systemroot%\system32\oem"
)

IF EXIST "%systemroot%\setup\scripts\*" (
   DEL /F /Q /S "%systemroot%\setup\scripts"
   RD /S /Q "%systemroot%\setup\scripts"
)

 


이 아래가 제가 추가한 내용입니다.


 

: Windows 7 SP1 업데이트(KB976932) 뜨는 오류 해결

   KB2533552-x64.msu /quiet

 

: Microsoft .NET Frameworks 4.6.1 통합하기

   dotNetFx461_Full_x86_x64_Slim.exe /y

 

popd
rd /s /q %SystemRoot%\Setup\Scripts


 

 

배치파일 스크립트 짜는 방법 배워본 적 없고요.

원래 저게 3개 다 따로따로인 것들입니다.

여러 개를 하나로 합치려면 popd 위에 추가해주면 된다고 해서 저렇게 추가했는데요.

 

순서를 바꿔 봐도 무조건 맨 위에 첫 번째 작업만 적용이 되고,

나머지 두 개의 작업은 적용이 안 되네요.

 

닷넷 프레임워크 설치를 맨 위로 하면 닷넷 프레임워크 설치만 적용되고,

업데이트 오류 패치를 맨 위로 하면 업데이트 오류 패치만 설치가 적용됩니다.

 

위에 세 가지 작업을 모두 적용하기 위해선 어떻게 수정해줘야 하는지 좀 가르쳐 주세요!

 

 

 

 

번호 제목 글쓴이 조회 등록일
[공지] 질문과 답변 게시판 이용간 유의사항 gooddew - -
68134 윈 도 우| m.2 ssd 9개 복사. 여러분의 선택은? 씻으면이정 474 03-22
68133 윈 도 우| 윈도우10 오른쪽마우스 질문 [2] gkgk77 690 03-22
68132 기 타| 배치파일에 대한 질문입니다. 고수님의 답변 기대.....^^ [5] 럭키보이 332 03-22
68131 윈 도 우| 윈10 복구 파티션 삭제 질문드립니다. [2] 아카라미 1360 03-22
» 윈 도 우| 윈도우 7 OEM 폴더 통합 관련 질문... [7] 디노야놀자 628 03-22
68129 윈 도 우| VISTA 최신 혹은 마지막 빌드 번호가 어떻게 되죠? [3] 뽐찌기뽐뽐 201 03-22
68128 윈 도 우| Intel Corporation driver update for Intel(R) HD Graphic... [1] redforce85 1038 03-22
68127 하드웨어| 포맷 후, 기존 하드가 할당되지 않는 경우. [4] xuser 437 03-22
68126 윈 도 우| 윈도우10 종류 질문 [3] wpswkdoo 1092 03-22
68125 윈 도 우| suk님과 고수분들께 여쭤볼것이 있습니다. [6] 주식회사로 745 03-22
68124 윈 도 우| vmware때문에 궁금한게 있어요 [2] 적상이 291 03-22
68123 윈 도 우| 하드웨어 변경 인증관련입니다. [7] arctype0 568 03-22
68122 윈 도 우| 크롬 및 엣지에서는 확장 프로그램이 IE 같이 안 되나요? [3] hwasung 304 03-22
68121 윈 도 우| 현재 윈도우7(oem)에서 10으로 업그레이드 가능한가요?? [14] 태양속으로 896 03-22
68120 하드웨어| Hdmi 연결한 모니터 화면이 꽉차지 않고 작게 나옵니다 [2] 감사한 1472 03-21
68119 윈 도 우| 윈도우10 설치후 내장하드에 있는 pe부팅을 위해 BCD편집 [4] 돌삐로세리 574 03-21
68118 기 타| 크롬 다운로드 할때 바로 열기 안되나요?? [1] FanTaG 1487 03-21
68117 기 타| http://www.kbench.com <- 요즘 갑자기 접속이 안되네요?. [2] 카메리아 664 03-21
68116 윈 도 우| 경고 메세지 질문 [5] 아롱진이슬 739 03-21
68115 소프트웨어| 팟플 질문입니다 [2] 달빛의공명 366 03-21
XE1.11.6 Layout1.4.8