@ECHO OFF&PUSHD %~DP0 &TITLE 绿化
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo.&Echo 请使用右键"以管理员身份运行"!&&Pause >NUL&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion

taskkill /f /im Xftp* >NUL 2>NUL
taskkill /f /im Xshell* >NUL 2>NUL
taskkill /f /im Xmanager* >NUL 2>NUL

if "%PROCESSOR_ARCHITECTURE%"=="x86" md "%CommonProgramFiles%\NetSarang"2>NUL
if "%PROCESSOR_ARCHITECTURE%"=="x86" copy /y XshellCore.tlb "%CommonProgramFiles%\NetSarang">NUL 2>NUL
if "%PROCESSOR_ARCHITECTURE%"=="x86" copy /y NsCopyHook2.dll "%CommonProgramFiles%\NetSarang">NUL 2>NUL

If "%PROCESSOR_ARCHITECTURE%"=="AMD64" md "%CommonProgramFiles(x86)%\NetSarang"2>NUL
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" copy /y XshellCore.tlb "%CommonProgramFiles(x86)%\NetSarang">NUL 2>NUL
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" copy /y NsCopyHook2.dll "%CommonProgramFiles(x86)%\NetSarang">NUL 2>NUL

if "%PROCESSOR_ARCHITECTURE%"=="x86" reg add "HKLM\SOFTWARE\NetSarang\Xmanager Enterprise\5\Xconfig" /f /ve  /d "%~dp0\" >NUL
if "%PROCESSOR_ARCHITECTURE%"=="x86" reg add "HKLM\SOFTWARE\NetSarang\Xmanager Enterprise\5" /f /v Path /d "%~dp0\" >NUL
if "%PROCESSOR_ARCHITECTURE%"=="x86" reg add "HKLM\SOFTWARE\NetSarang\Xmanager Enterprise\5" /f /v ProductKey /d "150226-116381-999582" >NUL
if "%PROCESSOR_ARCHITECTURE%"=="x86" reg add "HKLM\SOFTWARE\NetSarang\Xmanager Enterprise\5" /f /v MagicCode /t reg_binary /d "998CEBFD9980D03BCB9191528F9BD453DF0702001A" >NUL

If "%PROCESSOR_ARCHITECTURE%"=="AMD64" reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager Enterprise\5" /f /v Path /d "%~dp0\" >NUL
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager Enterprise\5" /f /v ProductKey /d "150226-116381-999582" >NUL
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager Enterprise\5" /f /v MagicCode /t reg_binary /d "998CEBFD9980D03BCB9191528F9BD453DF0702001A" >NUL

ECHO.&ECHO 绿化完成！创建快捷方式？
ECHO.&ECHO 是按任意键，否直接关闭！&PAUSE >NUL 2>NUL & CLS

mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Xbrowser.lnk""):b.TargetPath=""%~dp0Xbrowser.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")

ECHO.&ECHO 创建完成！按任意键退出！&PAUSE >NUL 2>NUL & EXIT