共享在这里,给需要的人使用。注意,如果是Vista系统,请用管理员权限打开批处理文件。
@echo Please run as administrator!
@choice /T 10 /D 1 /C 12 /M "1,Open GAC 2,Revert GAC"
goto answer%ERRORLEVEL%
:answer1
@echo Open GAC
@attrib -h -s %SystemRoot%\assembly\desktop.ini
@if exist %SystemRoot%\assembly\desktop.ini del /f %SystemRoot%\assembly\temp.ini
@ren %SystemRoot%\assembly\desktop.ini temp.ini
@start %SystemRoot%\assembly\
@goto end
:answer2
@echo Revert GAC
@ren %SystemRoot%\assembly\temp.ini desktop.ini
@attrib +h +s %SystemRoot%\assembly\desktop.ini
@goto end
:end
@echo End
@choice /T 10 /D 1 /C 12 /M "1,Open GAC 2,Revert GAC"
goto answer%ERRORLEVEL%
:answer1
@echo Open GAC
@attrib -h -s %SystemRoot%\assembly\desktop.ini
@if exist %SystemRoot%\assembly\desktop.ini del /f %SystemRoot%\assembly\temp.ini
@ren %SystemRoot%\assembly\desktop.ini temp.ini
@start %SystemRoot%\assembly\
@goto end
:answer2
@echo Revert GAC
@ren %SystemRoot%\assembly\temp.ini desktop.ini
@attrib +h +s %SystemRoot%\assembly\desktop.ini
@goto end
:end
@echo End