Set WorkDir=%~dp0 Set WorkDir=%WorkDir:~0,-1% Reg.exe import "%WorkDir%\winrar.reg" Reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /v "" /t REG_SZ /d "%WorkDir%\WinRAR.exe" /f Reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /v "Path" /t REG_SZ /d "%WorkDir%" /f Reg.exe add "HKLM\SOFTWARE\Classes\CLSID\{B41DB860-8EE4-11D2-9906-E49FADC173CA}\InprocServer32" /v "" /t REG_SZ /d "%WorkDir%\rarext.dll" /f Reg.exe add "HKLM\SOFTWARE\Classes\WinRAR\DefaultIcon" /v "" /t REG_SZ /d "%WorkDir%\WinRAR.exe,0" /f Reg.exe add "HKLM\SOFTWARE\Classes\WinRAR\shell\open\command" /v "" /t REG_SZ /d "\"%WorkDir%\WinRAR.exe\" \"%%1\"" /f