@ECHO OFF
TITLE www.Laomo.me ÂÌ»¯
:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " "  >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %*
exit /B
:gotPrivileges
setlocal & pushd .
cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul  &  shift /1)
PUSHD %~DP0 
taskkill /f /im Xftp* 2>nul 2>nul
sc stop "FlexNet Licensing Service">nul 2>nul
sc delete "FlexNet Licensing Service">nul 2>nul
if /i "%PROCESSOR_IDENTIFIER:~0,3%" == "X86" goto x86
if /i "%PROCESSOR_IDENTIFIER:~0,3%" NEQ "X86" goto x64
:x86
mkdir "%CommonProgramFiles%\NetSarang"
copy /y XshellCore.tlb "%CommonProgramFiles%\NetSarang"
copy /y NsCopyHook3.dll "%CommonProgramFiles%\NetSarang"
regsvr32 /s "%CommonProgramFiles%\NetSarang\NsCopyHook3.dll"
reg add "HKCU\SOFTWARE\NetSarang\Xftp\6\Personal" /f /v Notified /t REG_DWORD /d "1"
reg add "HKLM\SOFTWARE\NetSarang\Xftp\6" /f /v Path /d "%~dp0\"
reg add "HKLM\SOFTWARE\NetSarang\Xftp\6" /f /v Type /d "Register"
reg add "HKLM\SOFTWARE\NetSarang\Xftp\6" /f /v RESELLER /d ""
reg add "HKLM\SOFTWARE\NetSarang\Xftp\6" /f /v Company /d "www.Laomo.me"
reg add "HKLM\SOFTWARE\NetSarang\Xftp\6" /f /v UserName /d "roustar31"
reg add "HKLM\SOFTWARE\NetSarang\Xftp\6" /f /v Version /d "6.0.0119"
reg add "HKLM\SOFTWARE\NetSarang\Xftp\6" /f /v MagicCode /t reg_binary /d "91eec2eac5b011748b19a847dc3b68f2e20709001200"
reg add "HKLM\SOFTWARE\NetSarang\License\6\7" /f /v ProductKey /d "180918-116783-999110"
reg add "HKLM\SOFTWARE\NetSarang\License\6" /f /v ProductKey /d "180918-116783-999110"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Xftp.exe" /ve /d "%~DP0XXftp.exe" /f

reg add "HKCU\SOFTWARE\NetSarang\Xmanager\6\Personal" /f /v Notified /t REG_DWORD /d "1"
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6" /f /v Type /d "Register"
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6" /f /v RESELLER /d ""
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6" /f /v Company /d "www.Laomo.me"
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6" /f /v UserName /d "roustar31"
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6" /f /v Version /d "6.0.0119"
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6" /f /v MagicCode /t reg_binary /d "52e63cdebeec38eec34c62bc4a629189e2070b000100"
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6" /f /v MagicTime /t reg_binary /d "e2070b00040001000f00240022001500"
reg add "HKLM\SOFTWARE\NetSarang\Xmanager\6"  /f /v ProductKey /d "180918-116783-999110"

:x64
mkdir "%CommonProgramFiles(x86)%\NetSarang"
copy /y XshellCore.tlb "%CommonProgramFiles(x86)%\NetSarang"
copy /y NsCopyHook3.dll "%CommonProgramFiles(x86)%\NetSarang"
regsvr32 /s "%CommonProgramFiles(x86)%\NetSarang\NsCopyHook3.dll"
reg add "HKCU\SOFTWARE\Wow6432Node\NetSarang\Xftp\6\Personal" /f /v Notified /t REG_DWORD /d "1"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xftp\6" /f /v Type /d "Register"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xftp\6" /f /v RESELLER /d ""
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xftp\6" /f /v Path /d "%~dp0\"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xftp\6" /f /v Company /d "www.Laomo.me"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xftp\6" /f /v UserName /d "roustar31"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xftp\6" /f /v Version /d "6.0.0119"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xftp\6" /f /v MagicCode /t reg_binary /d "ced63e1d57a136b5b093f067a78e564ee20707001c00"

reg add "HKCU\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6\Personal" /f /v Notified /t REG_DWORD /d "1"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v Type /d "Register"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v RESELLER /d ""
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v Company /d "www.Laomo.me"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v UserName /d "roustar31"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v Version /d "6.0.0119"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v MagicCode /t reg_binary /d "52e63cdebeec38eec34c62bc4a629189e2070b000100"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v MagicTime /t reg_binary /d "e2070b00040001000f00240022001500"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\Xmanager\6" /f /v ProductKey /d "180918-116783-999110"
reg add "HKLM\SOFTWARE\Wow6432Node\NetSarang\License\6\7" /f /v ProductKey /d "180918-116783-999110"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Xftp.exe" /ve /d "%~DP0XXftp.exe" /f

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

start /wait "" "%~DP0hostsedit.exe" /a transact.netsarang.com
start /wait "" "%~DP0hostsedit.exe" /a update.netsarang.com
start /wait "" "%~DP0hostsedit.exe" /a www.netsarang.com
start /wait "" "%~DP0hostsedit.exe" /a www.netsarang.co.kr
start /wait "" "%~DP0hostsedit.exe" /a sales.netsarang.com

exit