질문과 답변

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

2017.03.22 19:27

디노야놀자 조회:626

 

 

윈도우 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 - -
68148 윈 도 우| 윈도우 부팅 질문입니다. [2] ibabu 311 03-23
68147 소프트웨어| 매크로 프로그램 문의좀.... [3] 소녀시대 379 03-23
68146 윈 도 우| https://connect.facebook.net/en_US/fbevents.js 스크립트... [1] 한중태양 434 03-23
68145 윈 도 우| 서버백업시 숨김폴더 표시여부. [1] 화잇곰 234 03-23
68144 윈 도 우| 오늘 혹시 윈도우7 시간이 15분 빠르게 나온분들 계실까요? [2] 오리방댕이 693 03-23
68143 윈 도 우| 배치파일로 압축하고 해제 가능한가요? [4] 신시계네요 497 03-23
68142 윈 도 우| sysprep 봉인 풀기 후 설정 문의 [1] wpswkdoo 313 03-23
68141 소프트웨어| 무선인터넷 암호화 중 가장 안전한 옵션은 어떤 거 인가요? [2] 윤아짱 371 03-23
68140 윈 도 우| 시스프랩에서 드라이버 초기화 질문이용 [1] 적상이 304 03-23
68139 하드웨어| 갤럭시 지포스 GTX660 C/d D5 2GB 그래픽카드연결질문 [3] LUX 383 03-23
68138 윈 도 우| 부팅시 outlook 실행 안 되게 하려면 [4] Abundance 586 03-23
68137 소프트웨어| 바이두 업로드?? [1] 바람낙엽 377 03-23
68136 소프트웨어| Camtasia Studio swf ,flv, 지원여부 문의 [2] mso 183 03-22
68135 윈 도 우| m.2 ssd 9개 복사. 여러분의 선택은? 씻으면이정 473 03-22
68134 윈 도 우| 윈도우10 오른쪽마우스 질문 [2] gkgk77 690 03-22
68133 기 타| 배치파일에 대한 질문입니다. 고수님의 답변 기대.....^^ [5] 럭키보이 330 03-22
68132 윈 도 우| 윈10 복구 파티션 삭제 질문드립니다. [2] 아카라미 1357 03-22
» 윈 도 우| 윈도우 7 OEM 폴더 통합 관련 질문... [7] 디노야놀자 626 03-22
68130 윈 도 우| VISTA 최신 혹은 마지막 빌드 번호가 어떻게 되죠? [3] 뽐찌기뽐뽐 201 03-22
68129 윈 도 우| Intel Corporation driver update for Intel(R) HD Graphic... [1] redforce85 1037 03-22
XE1.11.6 Layout1.4.8