SET Var0=%0
FOR /f "delims=" %%I in ("%Var0%") do Set TP=%%~dpI
SET TP=%TP:~0,-1%
REGEDIT /S %CurDrv%\PESOFT\WINRAR\WINRAR.REG
REG ADD HKCR\CLSID\{B41DB860-8EE4-11D2-9906-E49FADC173CA}\InProcServer32 /ve /t REG_SZ /d "%TP%\rarext.dll" /F >NUL
rem REG DELETE HKCR\.zip\ShellNew /F >NUL
REG ADD HKCR\WinRAR\DefaultIcon /ve /t REG_SZ /d "%TP%\WinRAR.exe,0" /F >NUL
REG ADD HKCR\WinRAR\shell\open\command /ve /t REG_SZ /d "\"%TP%\WinRAR.exe\" \"%%1\"" /F >NUL
REG ADD HKCR\WinRAR.REV\DefaultIcon /ve /t REG_SZ /d "%TP%\WinRAR.exe,1" /F >NUL
REG ADD HKCR\WinRAR.REV\shell\open\command /ve /t REG_SZ /d "\"%TP%\WinRAR.exe\" \"%%1\"" /F >NUL
REG ADD HKCR\WinRAR.ZIP\DefaultIcon /ve /t REG_SZ /d "%TP%\WinRAR.exe,0" /F >NUL
REG ADD HKCR\WinRAR.ZIP\shell\open\command /ve /t REG_SZ /d "\"%TP%\WinRAR.exe\" \"%%1\"" /F >NUL
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /ve /t REG_SZ /d "%TP%\WinRAR.exe" /F >NUL
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /v Path /t REG_SZ /d "%TP%" /F >NUL
If Not Exist "%SystemRoot%\System32\CABINET.DLL" Goto END
REG ADD HKCR\.CAB /ve /t REG_SZ /d WinRAR /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Set /t REG_DWORD /d 1 /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Exist /t REG_DWORD /d 1 /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Type /t REG_SZ /d "CLSID\{0CD7A5C0-9F37-11CE-AE65-08002B2E1262}" /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Content /t REG_SZ /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v ShellNew /t REG_SZ /F>NUL
pause>nul
end