@echo off
REM ----------------以下為設定檔-可修改-----------------
REM ----------------以下為讀卡機驅動程式----------------
set driver01_86=%~dp0AutoInstall\EZ100_Driver_32bit.exe
set driver01_64=%~dp0AutoInstall\EZ100_Driver_64bit.exe
REM ----------------以下為筆硯公文系統----------------
set driver02=%~dp0AutoInstall\docNinstall.msi
set driver03=%~dp0AutoInstall\docNcomp42@0_13a42.msi
REM ----以下為內政部HiCOS卡片管理工具ver3.0.3.62814----
set driver04=%~dp0AutoInstall\HiCOS_Client.exe
REM ----------------以下為IE啟動網頁----------------
set homepage01=http://gdms.chcg.gov.tw/
set homepage02=https://edit.chcg.gov.tw/kw/\0
set homepage03=http://172.20.3.50/httpweb/admin/public/login.asp\0
REM ----------------以下為程式碼-不可修改---------------------------
if "%PROCESSOR_ARCHITECTURE%" == "x86" goto x86
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto x64
rem 針對win10有32跟64位元的判斷
:x86
echo "x86"
echo 安裝MOICA內政部憑證管理程式所在路徑為 %driver04%
"%driver04%" /quiet /norestart
echo "安裝MOICA內政部憑證管理程式 OK"
set IEpath=HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
echo 設置首頁索引標籤
@reg add "%IEpath%" /v "Start Page" /t REG_SZ /d "%homepage01%" /f
@reg add "%IEpath%" /v "Secondary Start Pages" /t REG_MULTI_SZ /d
"%homepage02%%homepage03%" /f
echo 設置首頁索引標籤 OK
echo "設定安全區域ActiveX控制項...."
set bl=2
set regpath=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\%bl%
echo 正在進行ActiveX的配置,請稍候...
@reg add "%regpath%" /v "1001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1206" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1207" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1208" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1209" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120B" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "120C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1405" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1406" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1407" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1408" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1409" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1601" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1604" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1605" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1606" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1607" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1608" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1609" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "160A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "160B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1802" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1803" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1804" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1806" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1809" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1812" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A00" /d "131072" /t REG_DWORD /f
@reg add "%regpath%" /v "1A02" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A03" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A04" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1A05" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1A06" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A10" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1C00" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2000" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2005" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2007" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2100" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2101" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2102" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2103" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2104" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2105" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2106" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2107" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2108" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2200" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2300" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "2301" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2302" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2400" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2401" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2500" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2600" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2700" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2701" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2702" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2703" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2704" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2707" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2708" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2709" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "270B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270D" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "CurrentLevel" /d "0" /t REG_DWORD /f
@reg add "HKCU\Software\Microsoft\Internet Explorer\New Windows" /v
"PopupMgr" /t REG_DWORD /d "0" /f
@reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings" /v "SyncMode5" /t REG_DWORD /d "3" /f
echo "設定安全區域ActiveX控制項OK!!"
@echo 設定信任網站清單
regedit.exe /s "%~dp0AutoInstall\信任網站清單.reg"
@echo -------------------------------------------------------------------------------
@echo 設定完成
@echo 複製捷徑到桌面
@echo -------------------------------------------------------------------------------
copy "%~dp0AutoInstall\公文整合資訊系統.url" "%USERPROFILE%\desktop"
@echo 捷徑複製完成
echo 安裝讀卡機驅動程式所在路徑為 %driver01_86%
start /wait %driver01_86% /S /v/qn
echo "安裝讀卡機驅動程式 OK"
echo 安裝筆硯安裝程式所在路徑為 %driver02%
msiexec /package %driver02% /quiet /norestart
echo 安裝筆硯安裝程式所在路徑為 %driver03%
msiexec /package %driver03% /quiet /norestart
echo "安裝筆硯安裝程式 OK"
echo "請重新開機,完成所有設定"
pause
exit
:x64
echo "x64"
echo 安裝MOICA內政部憑證管理程式所在路徑為 %driver04%
"%driver04%" /quiet /norestart
echo "安裝MOICA內政部憑證管理程式 OK"
set IEpath=HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
echo 設置首頁索引標籤
@reg add "%IEpath%" /v "Start Page" /t REG_SZ /d "%homepage01%" /f
@reg add "%IEpath%" /v "Secondary Start Pages" /t REG_MULTI_SZ /d "%homepage02%%homepage03%" /f
echo 設置首頁索引標籤 OK
echo "設定安全區域ActiveX控制項...."
set bl=2
set regpath=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\%bl%
echo 正在進行ActiveX的配置,請稍候...
@reg add "%regpath%" /v "1001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1206" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1207" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1208" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1209" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120B" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "120C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1405" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1406" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1407" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1408" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1409" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1601" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1604" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1605" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1606" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1607" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1608" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1609" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "160A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "160B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1802" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1803" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1804" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1806" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1809" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1812" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A00" /d "131072" /t REG_DWORD /f
@reg add "%regpath%" /v "1A02" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A03" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A04" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1A05" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1A06" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A10" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1C00" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2000" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2005" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2007" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2100" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2101" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2102" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2103" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2104" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2105" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2106" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2107" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2108" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2200" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2300" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "2301" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2302" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2400" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2401" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2500" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2600" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2700" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2701" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2702" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2703" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2704" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2707" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2708" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2709" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "270B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270D" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "CurrentLevel" /d "0" /t REG_DWORD /f
@reg add "HKCU\Software\Microsoft\Internet Explorer\New Windows" /v "PopupMgr" /t REG_DWORD /d "0" /f
@reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d "3" /f
echo "設定安全區域ActiveX控制項OK!!"
@echo 設定信任網站清單
regedit.exe /s "%~dp0AutoInstall\信任網站清單.reg"
@echo -------------------------------------------------------------------------------
@echo 設定完成
@echo 複製捷徑到桌面
@echo -------------------------------------------------------------------------------
copy "%~dp0AutoInstall\公文整合資訊系統.url" "%USERPROFILE%\desktop"
@echo 捷徑複製完成
echo 安裝讀卡機驅動程式所在路徑為 %driver01_64%
start /wait %driver01_64% /S /v/qn
echo "安裝讀卡機驅動程式 OK"
echo 安裝筆硯安裝程式所在路徑為 %driver02%
msiexec /package %driver02% /quiet /norestart
echo 安裝筆硯安裝程式所在路徑為 %driver03%
msiexec /package %driver03% /quiet /norestart
echo "安裝筆硯安裝程式 OK"
echo "請重新開機,完成所有設定"
pause
exit
利用虛擬機安裝 Windows 10 x64 1909 版本
下圖是 IE11 左邊是關於初始的 ActiveX 的設定 右邊是相對應的初始登錄檔Registry 的設定
下圖是 IE11 左邊是關於公文 ActiveX 的設定 右邊是相對應的公文登錄檔Registry 的設定
下圖是比較表
接下來,就把這些數值寫進bat
@echo off
if "%PROCESSOR_ARCHITECTURE%" == "x86" goto x86
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto x64
rem 針對win10有32跟64位元的判斷
:x86
echo "x86"
set driver04=%~dp0AutoInstall\HiCOS_Client.exe
echo 安裝MOICA內政部憑證管理程式所在路徑為 %driver04%
"%~dp0AutoInstall\HiCOS_Client.exe" /quiet /norestart
echo "安裝MOICA內政部憑證管理程式 OK"
set IEpath=HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
echo 設置首頁索引標籤
@reg add "%IEpath%" /v "Start Page" /t REG_SZ /d "http://gdms.chcg.gov.tw/" /f
@reg add "%IEpath%" /v "Secondary Start Pages" /t REG_MULTI_SZ /d "https://edit.chcg.gov.tw/kw/\0http://172.20.3.50/httpweb/admin/public/login.asp\0" /f
echo 設置首頁索引標籤 OK
echo "設定安全區域ActiveX控制項...."
set bl=2
set regpath=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\%bl%
echo 正在進行ActiveX的配置,請稍候...
@reg add "%regpath%" /v "1001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1206" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1207" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1208" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1209" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120B" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "120C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1405" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1406" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1407" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1408" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1409" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1601" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1604" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1605" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1606" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1607" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1608" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1609" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "160A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "160B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1802" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1803" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1804" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1806" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1809" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1812" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A00" /d "131072" /t REG_DWORD /f
@reg add "%regpath%" /v "1A02" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A03" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A04" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1A05" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1A06" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A10" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1C00" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2000" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2005" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2007" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2100" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2101" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2102" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2103" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2104" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2105" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2106" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2107" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2108" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2200" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2300" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "2301" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2302" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2400" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2401" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2500" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2600" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2700" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2701" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2702" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2703" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2704" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2707" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2708" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2709" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "270B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270D" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "CurrentLevel" /d "0" /t REG_DWORD /f
@reg add "HKCU\Software\Microsoft\Internet Explorer\New Windows" /v "PopupMgr" /t REG_DWORD /d "0" /f
@reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d "3" /f
echo "設定安全區域ActiveX控制項OK!!"
@echo 設定信任網站清單
regedit.exe /s "%~dp0AutoInstall\信任網站清單.reg"
@echo -------------------------------------------------------------------------------
@echo 設定完成
@echo 複製捷徑到桌面
@echo -------------------------------------------------------------------------------
copy "%~dp0AutoInstall\公文整合資訊系統.url" "%USERPROFILE%\desktop"
@echo 捷徑複製完成
set driver01=%~dp0AutoInstall\EZ100_Driver_32bit.exe
set driver02=%~dp0AutoInstall\docNinstall.msi
set driver03=%~dp0AutoInstall\docNcomp42@0_13a42.msi
echo 安裝讀卡機驅動程式所在路徑為 %driver01%
start /wait %driver01% /S /v/qn
echo "安裝讀卡機驅動程式 OK"
echo 安裝筆硯安裝程式所在路徑為 %driver02%
msiexec /package %driver02% /quiet /norestart
echo 安裝筆硯安裝程式所在路徑為 %driver03%
msiexec /package %driver03% /quiet /norestart
echo "安裝筆硯安裝程式 OK"
echo "請重新開機,完成所有設定"
pause
exit
:x64
echo "x64"
set driver04=%~dp0AutoInstall\HiCOS_Client.exe
echo 安裝MOICA內政部憑證管理程式所在路徑為 %driver04%
"%~dp0AutoInstall\HiCOS_Client.exe" /quiet /norestart
echo "安裝MOICA內政部憑證管理程式 OK"
REM 設置IE首頁索引標籤
set IEpath=HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
echo 設置首頁索引標籤
@reg add "%IEpath%" /v "Start Page" /t REG_SZ /d "http://gdms.chcg.gov.tw/" /f
@reg add "%IEpath%" /v "Secondary Start Pages" /t REG_MULTI_SZ /d "https://edit.chcg.gov.tw/kw/\0http://172.20.3.50/httpweb/admin/public/login.asp\0" /f
echo 設置首頁索引標籤 OK
echo "設定安全區域ActiveX控制項...."
set bl=2
set regpath=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\%bl%
echo 正在進行ActiveX的配置,請稍候...
@reg add "%regpath%" /v "1001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1206" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1207" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1208" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1209" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120B" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "120C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1405" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1406" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1407" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1408" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1409" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "140C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1601" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1604" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1605" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1606" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1607" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1608" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1609" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "160A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "160B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1802" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1803" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1804" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1806" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1809" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1812" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A00" /d "131072" /t REG_DWORD /f
@reg add "%regpath%" /v "1A02" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A03" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A04" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "1A05" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1A06" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1A10" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "1C00" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2000" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2005" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2007" /d "65536" /t REG_DWORD /f
@reg add "%regpath%" /v "2100" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2101" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2102" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2103" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2104" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2105" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2106" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2107" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2108" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2200" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2300" /d "1" /t REG_DWORD /f
@reg add "%regpath%" /v "2301" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2302" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2400" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2401" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2402" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2500" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2600" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2700" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2701" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2702" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2703" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2704" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2707" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2708" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2709" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "270B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270D" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "CurrentLevel" /d "0" /t REG_DWORD /f
@reg add "HKCU\Software\Microsoft\Internet Explorer\New Windows" /v "PopupMgr" /t REG_DWORD /d "0" /f
@reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d "3" /f
echo "設定安全區域ActiveX控制項OK!!"
@echo 設定信任網站清單
regedit.exe /s "%~dp0AutoInstall\信任網站清單.reg"
@echo -------------------------------------------------------------------------------
@echo 設定完成
@echo 複製捷徑到桌面
@echo -------------------------------------------------------------------------------
copy "%~dp0AutoInstall\公文整合資訊系統.url" "%USERPROFILE%\desktop"
@echo 捷徑複製完成
set driver01=%~dp0AutoInstall\EZ100_Driver_64bit.exe
set driver02=%~dp0AutoInstall\docNinstall.msi
set driver03=%~dp0AutoInstall\docNcomp42@0_13a42.msi
echo 安裝讀卡機驅動程式所在路徑為 %driver01%
start /wait %driver01% /S /v/qn
echo "安裝讀卡機驅動程式 OK"
echo 安裝筆硯安裝程式所在路徑為 %driver02%
msiexec /package %driver02% /quiet /norestart
echo 安裝筆硯安裝程式所在路徑為 %driver03%
msiexec /package %driver03% /quiet /norestart
echo "安裝筆硯安裝程式 OK"
echo "請重新開機,完成所有設定"
pause
exit
20200731
感恩廠商的bat檔。藉著觀摩廠商的bat檔,修改自己的bat檔。但是還是有些不完美!!
配合不上 Windows 10 x64,還是要回到原點。
公文系統自動安裝20200731.rar
@echo off
if "%PROCESSOR_ARCHITECTURE%" == "x86" goto x86
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto x64
rem 針對win7有32跟64位元的判斷
:x86
echo "x86"
set driver04=%~dp0AutoInstall\HiCOS_Client.exe
echo 安裝MOICA內政部憑證管理程式所在路徑為 %driver04%
"%~dp0AutoInstall\HiCOS_Client.exe" /quiet /norestart
echo "安裝MOICA內政部憑證管理程式 OK"
set IEpath=HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
echo 設置首頁索引標籤
@reg add "%IEpath%" /v "Start Page" /t REG_SZ /d "http://gdms.chcg.gov.tw/" /f
@reg add "%IEpath%" /v "Secondary Start Pages" /t REG_MULTI_SZ /d "https://edit.chcg.gov.tw/kw/\0http://172.20.3.50/httpweb/admin/public/login.asp\0" /f
echo 設置首頁索引標籤 OK
echo "設定安全區域ActiveX控制項...."
set bl=2
set regpath=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\%bl%
echo 正在進行ActiveX的配置,請稍候...
@reg add "%regpath%" /v "1001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1208" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1209" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1405" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2000" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2702" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2200" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1406" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1609" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "160A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
Reg.exe add "HKCU\Software\Microsoft\Internet Explorer\New Windows" /v "PopupMgr" /t REG_DWORD /d "0" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d "3" /f
echo "設定安全區域ActiveX控制項OK!!"
@echo 設定信任網站清單
regedit.exe /s "%~dp0AutoInstall\信任網站清單.reg"
@echo -------------------------------------------------------------------------------
@echo 設定完成
@echo 複製捷徑到桌面
@echo -------------------------------------------------------------------------------
copy "%~dp0AutoInstall\公文整合資訊系統.url" "%USERPROFILE%\desktop"
@echo 捷徑複製完成
set driver01=%~dp0AutoInstall\EZ100_Driver_32bit.exe
set driver02=%~dp0AutoInstall\docNinstall.msi
set driver03=%~dp0AutoInstall\docNcomp42@0_13a42.msi
echo 安裝讀卡機驅動程式所在路徑為 %driver01%
start /wait %driver01% /S /v/qn
echo "安裝讀卡機驅動程式 OK"
echo 安裝筆硯安裝程式所在路徑為 %driver02%
msiexec /package %driver02% /quiet /norestart
echo 安裝筆硯安裝程式所在路徑為 %driver03%
msiexec /package %driver03% /quiet /norestart
echo "安裝筆硯安裝程式 OK"
echo "請重新開機,完成所有設定"
pause
exit
:x64
echo "x64"
set driver04=%~dp0AutoInstall\HiCOS_Client.exe
echo 安裝MOICA內政部憑證管理程式所在路徑為 %driver04%
"%~dp0AutoInstall\HiCOS_Client.exe" /quiet /norestart
echo "安裝MOICA內政部憑證管理程式 OK"
REM 設置IE首頁索引標籤
set IEpath=HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
echo 設置首頁索引標籤
@reg add "%IEpath%" /v "Start Page" /t REG_SZ /d "http://gdms.chcg.gov.tw/" /f
@reg add "%IEpath%" /v "Secondary Start Pages" /t REG_MULTI_SZ /d "https://edit.chcg.gov.tw/kw/\0http://172.20.3.50/httpweb/admin/public/login.asp\0" /f
echo 設置首頁索引標籤 OK
echo "設定安全區域ActiveX控制項...."
set bl=2
set regpath=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\%bl%
echo 正在進行ActiveX的配置,請稍候...
@reg add "%regpath%" /v "1001" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1004" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1208" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1209" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "120B" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1405" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "2000" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2201" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2702" /d "3" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "2200" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1406" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "1609" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "160A" /d "0" /t REG_DWORD /f
@reg add "%regpath%" /v "270C" /d "0" /t REG_DWORD /f
Reg.exe add "HKCU\Software\Microsoft\Internet Explorer\New Windows" /v "PopupMgr" /t REG_DWORD /d "0" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d "3" /f
echo "設定安全區域ActiveX控制項OK!!"
@echo 設定信任網站清單
regedit.exe /s "%~dp0AutoInstall\信任網站清單.reg"
@echo -------------------------------------------------------------------------------
@echo 設定完成
@echo 複製捷徑到桌面
@echo -------------------------------------------------------------------------------
copy "%~dp0AutoInstall\公文整合資訊系統.url" "%USERPROFILE%\desktop"
@echo 捷徑複製完成
set driver01=%~dp0AutoInstall\EZ100_Driver_64bit.exe
set driver02=%~dp0AutoInstall\docNinstall.msi
set driver03=%~dp0AutoInstall\docNcomp42@0_13a42.msi
echo 安裝讀卡機驅動程式所在路徑為 %driver01%
start /wait %driver01% /S /v/qn
echo "安裝讀卡機驅動程式 OK"
echo 安裝筆硯安裝程式所在路徑為 %driver02%
msiexec /package %driver02% /quiet /norestart
echo 安裝筆硯安裝程式所在路徑為 %driver03%
msiexec /package %driver03% /quiet /norestart
echo "安裝筆硯安裝程式 OK"
echo "請重新開機,完成所有設定"
pause
exit