@echo off

@rem ***************************************************************************
@rem *                                                                         *
@rem * Use this cmd file to enable/disable VSS integration with the VC++ IDE.  *
@rem *                                                                         *
@rem * Command line arguments are: [ enable | disable ] indicating which       *
@rem * action to take.                                                         *
@rem *                                                                         *
@rem * NOTE: This cmd file ONLY WORKS WITH MSVC++ 5.0!                         *
@rem *                                                                         *
@rem ***************************************************************************

setlocal

set DISABLED=

if /i "%1"=="enable" set DISABLED=0
if /i "%1"=="disable" set DISABLED=1

if "%DISABLED%"=="" goto usage

set TMPFILE=%TEMP%\zzztmp.inf
if exist %TMPFILE% @echo Error: Temp file %TMPFILE% already exists! && goto end

@echo [Version] > %TMPFILE%
@echo signature="$Windows NT$" >> %TMPFILE%
@echo. >> %TMPFILE%
@echo [DefaultInstall] >> %TMPFILE%
@echo AddReg=VssInt.AddReg >> %TMPFILE%
@echo. >> %TMPFILE%
@echo [VssInt.AddReg] >> %TMPFILE%
@echo HKCU, Software\Microsoft\DevStudio\5.0\Source Control, Disabled, 0x00010001, %DISABLED% >> %TMPFILE%
@echo. >> %TMPFILE%

RUNDLL32.EXE syssetup,SetupInfObjectInstallAction DefaultInstall 128 %TMPFILE%

del %TMPFILE% > nul

goto end

:usage
@echo.
@echo Usage %0:
@echo   %0 [ enable ^| disable ]
@echo.

:end
endlocal
