IF "%PROCESSOR_ARCHITECTURE%" == "IA64" Set DLLPATH=%~dp0%ShellExtensionX64.dll
IF "%PROCESSOR_ARCHITECTURE%" == "ARM64" Set DLLPATH=%~dp0%ShellExtensionARM64.dll
-IF "%1" == "/u" Goto Uninstall
-IF "%1" == "/U" Goto Uninstall
+SET OPTIONS=
+FOR %%i IN (%*) DO (
+ IF "%%i" == "/s" SET OPTIONS=%OPTIONS% /s
+ IF "%%i" == "/S" SET OPTIONS=%OPTIONS% /s
+)
+
+FOR %%i IN (%*) DO (
+ IF "%%i" == "/u" Goto Uninstall
+ IF "%%i" == "/U" Goto Uninstall
+)
Echo Registering ShellExtension.dll...
-IF "%OS%" == "" %WINDIR%\System\RegSvr32 "%DLLPATH%"
+IF "%OS%" == "" %WINDIR%\System\RegSvr32 %OPTIONS% "%DLLPATH%"
IF "%OS%" == "" Goto End
-Call :Execute regsvr32 "%DLLPATH%"
+Call :Execute regsvr32 %OPTIONS% "%DLLPATH%"
IF EXIST "%~dp0\WinMerge32BitPluginProxy.exe" Call :Execute "%~dp0\WinMerge32BitPluginProxy.exe" /RegServer
Goto End
:Uninstall
Echo UnRegistering ShellExtension.dll...
-IF "%OS%" == "" %WINDIR%\System\RegSvr32 /u "%DLLPATH%"
+IF "%OS%" == "" %WINDIR%\System\RegSvr32 /u %OPTIONS% "%DLLPATH%"
IF "%OS%" == "" Goto End
-Call :Execute regsvr32 /u "%DLLPATH%"
+Call :Execute regsvr32 /u %OPTIONS% "%DLLPATH%"
IF EXIST "%~dp0\WinMerge32BitPluginProxy.exe" Call :Execute "%~dp0\WinMerge32BitPluginProxy.exe" /UnregServer
Goto End
Ver | %WINDIR%\System32\Find " 5." > NUL
IF NOT ERRORLEVEL 1 (
rem Windows 2000, XP, Sever 2003
- %1 %2 %3
+ %1 %2 %3 %4
) Else (
rem Windows Vista, Server 200x, Server 201x, Windows 8, Windows 10
Echo args="": For Each a in WScript.Arguments: If InStr^(a, " "^) ^> 0 Then args = args ^& """" ^& a ^& """ " Else args = args ^& a ^& " " End If: Next: CreateObject^("Shell.Application"^).ShellExecute "%~1", args, "", "runas" > "%TEMP%\Elevated.vbs"
- Wscript //nologo "%TEMP%\Elevated.vbs" %2 %3
+ Wscript //nologo "%TEMP%\Elevated.vbs" %2 %3 %4
Del "%TEMP%\Elevated.vbs" 2> NUL
)
Goto :EOF
IF "%PROCESSOR_ARCHITECTURE%" == "IA64" Set DLLPATH=%~dp0%ShellExtensionX64.dll
IF "%PROCESSOR_ARCHITECTURE%" == "ARM64" Set DLLPATH=%~dp0%ShellExtensionARM64.dll
-IF "%1" == "/u" Goto Uninstall
-IF "%1" == "/U" Goto Uninstall
+SET OPTIONS=
+FOR %%i IN (%*) DO (
+ IF "%%i" == "/s" SET OPTIONS=%OPTIONS% /s
+ IF "%%i" == "/S" SET OPTIONS=%OPTIONS% /s
+)
+
+FOR %%i IN (%*) DO (
+ IF "%%i" == "/u" Goto Uninstall
+ IF "%%i" == "/U" Goto Uninstall
+)
Echo Registering ShellExtension.dll for current user only...
-%WINDIR%\System32\RegSvr32 /n /i:user "%DLLPATH%"
+%WINDIR%\System32\RegSvr32 /n %OPTIONS% /i:user "%DLLPATH%"
IF EXIST "%~dp0\WinMerge32BitPluginProxy.exe" "%~dp0\WinMerge32BitPluginProxy.exe" /RegServerPerUser
Goto End
:Uninstall
Echo UnRegistering ShellExtension.dll for current user only...
-%WINDIR%\System32\RegSvr32 /u /n /i:user "%DLLPATH%"
+%WINDIR%\System32\RegSvr32 /u /n %OPTIONS% /i:user "%DLLPATH%"
IF EXIST "%~dp0\WinMerge32BitPluginProxy.exe" "%~dp0\WinMerge32BitPluginProxy.exe" /UnregServerPerUser
Goto End