Languages:
[EN] English |
[KO] 한국어
Overview
소개
A production-proven enterprise environment automation system built on Windows Batch Script, validated through years of real-world deployment.
수년간 현장 적용을 통해 검증된, 배치 스크립트 기반의 엔터프라이즈 환경 자동화 시스템
Field Results
실제 현장 적용 효과
- PC replacement cycles improved by 2–4×
- Labor costs reduced by 30–50%
- Tasks that previously took all day now complete within half a day
- Minimal operator involvement required
- PC 교체 작업 속도 2~4배 향상
- 인건비 30~50% 절감
- 하루 종일 걸리던 작업이 반나절 전후로 마무리
- 작업자 개입 거의 없음
Development Record
개발 기록
https://project-ap.blogspot.com/2021/12/windows-migration-helper.html
Process Diagram
프로세스 다이어그램
At a Glance
This project is a full-scale PC migration & deployment automation framework implemented entirely using Windows Batch Script.
Originally started during the Windows XP era for simple IP migration, it evolved over years into a modular, dynamic, production-grade automation system capable of handling complete enterprise PC replacement workflows.
Despite being written in Batch, the system demonstrates advanced software engineering concepts:
- Modular architecture
- Runtime dynamic linking
- Lightweight database implementation
- Console UI framework
- Fault-tolerant execution & debugging
- Profile & environment management
Core Architecture
Modular System Design
| Module | Responsibility |
|---|---|
| INI Parser | Configuration parsing & management |
| UI Engine | Console UI rendering, layout, alignment, frames |
| Text Processor | String handling, trimming, formatting |
| Settings Engine | Environment & user profile management |
| Mini-DB | Section / Key / Value storage system |
Each module supports:
- Standalone execution
- Parent-child module execution
- Required dependency execution
Central Library System
Lib.cmd
- Acts as a global runtime library
- All major scripts import shared functions
- Prevents duplicate loading
- Manages runtime context & environment
- Provides core utilities across the system
Runtime Dynamic Linking (Key Feature)
At runtime, required scripts are:
- Dynamically merged
- Compiled into a temporary executable batch file
- Executed as one program
- Automatically cleaned up
This behaves similarly to a C/C++ dynamic linker & loader system, but implemented purely in Batch Script.
Enterprise Migration Workflow
Backup Process (PC_Backup.cmd)
- Host info (Workgroup / Domain)
- Network adapter configuration
- Printer settings & driver mapping
- User files & application data
Restore Process (PC_Restore.cmd)
- Restore host & network environment
- Apply printer configuration
- Join Workgroup / Domain
- Restore data & user environment
- Launch automatic installation pipeline
Multi-Stage Reboot-Aware Installation Pipeline
- Supports multi-stage installation workflows across mandatory system reboots
- Automatically resumes execution after restart
- Cleans up previous stage entries before registering next stage
In real enterprise environments, certain security software may require manual intervention,
including user-triggered reboots, due to unpredictable installer behavior or system-level restrictions.
The pipeline is designed to tolerate such interruptions and safely resume execution after restart.
Driver Generation & Deployment (PT_Driver_Generator.cmd)
- Manufacturer-based driver parsing
- INF file analysis
- Dynamic driver metadata generation
- Architecture detection (32 / 64-bit)
- Auto installation & testing
Internal Technologies
- Dynamic code composition (runtime batch merging & execution)
- Mini database engine (Section / Key / Value)
- Console UI framework (TextBox, alignment, layout, formatting)
- Profile engine (user & session configuration)
- Error handling with runtime dump & failure tracing
- Multiple execution models (Standalone / Subset / Required subset)
Productivity Impact
- 2–4× faster PC replacement cycles
- 30–50% reduction in labor cost
- Zero external executables -> high security compatibility
- Minimal operator involvement: USB -> Backup -> New PC -> Restore -> Next PC
Final Summary
Rather than a simple script, This is a full automation framework built in one of the most limited languages available.
요약
이 프로젝트는 Windows Batch Script만으로 구현된 대규모 PC 마이그레이션 및 배포 자동화 프레임워크입니다.
Windows XP 시절 단순한 IP 이전 작업을 위해 시작되었으며, 수년에 걸쳐 발전하여 현재는 기업 환경의 PC 교체 전체 프로세스를 처리할 수 있는 모듈화되고 동적인 프로덕션급 자동화 시스템으로 성장했습니다.
Batch로 작성되었음에도 불구하고, 다음과 같은 고급 소프트웨어 엔지니어링 개념을 포함합니다.
- 모듈형 아키텍처
- 런타임 동적 링킹
- 경량 데이터베이스 구현
- 콘솔 UI 프레임워크
- 오류 내성 실행 구조 및 디버깅 시스템
- 프로파일 및 환경 관리 시스템
코어 아키텍처
모듈형 시스템 설계
| 모듈 | 역할 |
|---|---|
| INI Parser | 설정 파싱 및 관리 |
| UI Engine | 콘솔 UI 렌더링, 레이아웃, 정렬, 프레임 처리 |
| Text Processor | 문자열 처리, 트리밍, 포맷팅 |
| Settings Engine | 환경 및 사용자 프로파일 관리 |
| Mini-DB | 섹션 / 키 / 값 저장 시스템 |
각 모듈은 다음 실행 모델을 지원합니다.
- 단독 실행
- 상위 / 하위 모듈 연계 실행
- 필수 의존 모듈 실행
중앙 라이브러리 시스템
Lib.cmd
- 전역 런타임 라이브러리 역할 수행
- 모든 주요 스크립트에서 공통 함수 공유
- 중복 로딩 방지
- 런타임 컨텍스트 및 환경 관리
- 시스템 전반에 걸친 핵심 유틸리티 제공
런타임 동적 링킹 (핵심 기능)
실행 시 필요한 스크립트는 다음과 같은 방식으로 처리됩니다.
- 필요한 모듈을 동적으로 병합
- 임시 실행 배치 파일로 컴파일
- 단일 프로그램처럼 실행
- 실행 종료 후 자동 정리
이는 C/C++의 동적 링커 및 로더 시스템과 유사한 동작을 Batch Script만으로 구현한 구조입니다.
엔터프라이즈 마이그레이션 워크플로우
백업 프로세스 (PC_Backup.cmd)
- 호스트 정보 (Workgroup / Domain)
- 네트워크 어댑터 설정
- 프린터 설정 및 드라이버 매핑
- 사용자 파일 및 애플리케이션 데이터
복원 프로세스 (PC_Restore.cmd)
- 호스트 및 네트워크 환경 복원
- 프린터 구성 적용
- Workgroup / Domain 자동 가입
- 데이터 및 사용자 환경 복원
- 자동 설치 파이프라인 실행
다단계 재부팅 인식 설치 파이프라인
- 필수 시스템 재부팅 전반에 걸쳐 다단계 설치 워크플로 지원
- 재시작 후 자동으로 실행을 재개
- 다음 단계를 등록하기 전에 이전 단계 항목을 정리.
실제 기업 환경에서는 특정 보안 소프트웨어의 경우 설치 프로그램의 예측 불가능한 동작이나 시스템 수준의 제한으로 인해 사용자가 재부팅하는 등의 수동 개입이 필요할 수 있습니다.
이 파이프라인은 이러한 중단을 허용하고 재부팅 후 안전하게 실행을 재개하도록 설계되었습니다.
드라이버 생성 및 배포 (PT_Driver_Generator.cmd)
- 제조사 기반 드라이버 파싱
- INF 파일 분석
- 동적 드라이버 메타데이터 생성
- 아키텍처 감지 (32 / 64-bit)
- 자동 설치 및 테스트
내부 기술 요소
- 동적 코드 합성 (런타임 배치 병합 및 실행)
- 미니 데이터베이스 엔진 (Section / Key / Value)
- 콘솔 UI 프레임워크 (TextBox, 정렬, 레이아웃, 포맷팅)
- 프로파일 엔진 (사용자 및 세션 구성 관리)
- 런타임 덤프 및 장애 추적 기반 오류 처리
- 다중 실행 모델 (단독 / 부분 / 필수 모듈 실행)
생산성 효과
- PC 교체 작업 속도 2~4배 향상
- 인건비 30~50% 절감
- 외부 실행 파일 없이 동작 -> 높은 보안 환경 호환
- 작업 흐름 단순화: USB -> 백업 -> 새 PC -> 복원 -> 다음 PC
최종 요약
단순한 스크립트라기 보다, 가장 제약이 심한 언어 중 하나로 구현된 완전한 자동화 프레임워크입니다.

Comments
Post a Comment