Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Microsoft .NET | .NET Framework

Модерирует : gyra, Maz

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

Maxim_um

Advanced Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

Код:
@echo off
title Easy Ngen Runner v4 for .NET 4/4.5/4.6 by Burf
 
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
goto :admincheckok
) || (
echo      -------
echo  *** WARNING ***
echo      -------
echo.
echo.
echo ADMINISTRATOR PRIVILEGES NOT DETECTED!
call :line
echo.
echo.
echo This script must be run with administrator privileges!
echo.
echo To do so, right click on this script and select 'Run As Administrator'
echo.
goto :fin
)
 
:admincheckok
"%windir%\system32\reg.exe" query "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "BuildLabEx" >"%temp%\winver.burf"
find /i "AMD64" <"%temp%\winver.burf">nul
if %errorlevel% equ 0 set arch=x64
if /i %PROCESSOR_ARCHITECTURE% equ x86 (set arch=x86)
for /f "tokens=2 delims=[]" %%G in ('ver') do (for /f "tokens=2" %%G in ('echo %%G') do (set winnum=%%G))
if %winnum% lss 10.0.10130 set win=Legacy Windows %arch% support
if %winnum% geq 10.0.10130 (
set task=1
for /f "skip=2 tokens=3,4,6,7 delims=. " %%G in ('type "%temp%\winver.burf"') do (set win=Windows 10 %arch% Build %%G.%%H {%%I %%J})
)
del "%temp%\winver.burf"
 
if not exist "%windir%\Microsoft.NET\Framework\v4.0.30319" goto :notinstalled
 
:menu
call :title
echo.
echo 1. Run full Ngen 'update' task
echo.
echo 2. Run standard Ngen 'update' task
echo.
echo 3. Execute queued Ngen items (what Windows does in background)
echo.
echo 4. Visit the 'homepage' of Burf:
echo    (https://www.dropbox.com/sh/yvo0u5lrac3whv2/j3Uhlqc9j8/)
echo.
echo 5. Information
echo.
echo 6. Exit
echo.
echo.  
echo.
choice /c 123456 /N /M "Please enter your selection> "
if errorlevel 6 goto :eof
if errorlevel 5 goto :info
if errorlevel 4 start https://www.dropbox.com/sh/yvo0u5lrac3whv2/j3Uhlqc9j8&goto :menu
if errorlevel 3 goto :ngub
if errorlevel 2 goto :ngus
if errorlevel 1 goto :nguf
 
 
 
:info
call :title
echo This script allows your to easily run the .NET Framework tool Ngen
echo (Native Image Generator) program.
echo.
echo The three options in the menu represent the three different methods in
echo which is can be run:
echo Menu option 1 - Recreates all images
echo Menu option 2 - Processes images that have become invalid
echo Menu option 3 - Execute items already in queue to be processed by Windows
echo.
echo Option 1 is really only beneficial after a .NET Framework update has been
echo installed. Option 3 executes those items already in the queue, this just
echo processes the items immediately instead of during idle processor time.
echo.
echo Option 2 should be used for general use, option 1 after a .NET Framework
echo update, and option 3 is only provided for completeness (least useful).
echo.
echo It makes sense to have queued items processed and native images updated
echo before they are actually required!
echo.
echo.
echo.
echo Press any key to return to menu...
pause >nul
goto :menu
 
 
:nguf
call :title
echo Running x86 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe" update /force
if defined task (
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngentask.exe" /runtimewide
)
echo.
if %arch% equ x86 (goto :nudone)
echo.
echo Now running x64 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" update /force
if defined task (
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe" /runtimewide
)
goto :nudone
 
 
:ngus
call :title
echo Running x86 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe" update
if defined task (
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngentask.exe" /runtimewide
)
 
 
echo.
if %arch% equ x86 (goto :nudone)
echo.
echo Now running x64 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" update
if defined task (
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe" /runtimewide
)
goto :nudone
 
:ngub
call :title
echo Running x86 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe" executequeueditems
if defined task (
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngentask.exe" /runtimewide
)
 
 
echo.
if %arch% equ x86 (goto :nudone)
echo.
echo Now running x64 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" executequeueditems
if defined task (
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe" /runtimewide
)
goto :nudone
 
 
:nudone
echo.
echo.
echo Done! Please note that some 'errors' may have appeared. These are, for the
echo most part, not unexpected and are not deemed critical.
echo.
goto :fin
 
 
:title
cls
echo --------------------------------------
echo Easy Ngen Runner v4 for .NET 4/4.5/4.6 by Burf
echo --------------------------------------
echo %win%
echo.
goto :eof
 
 
:fin
echo.
echo Press any key to exit...
pause >nul
goto :eof
 
 
:notinstalled
echo Microsoft .NET Framework 4, 4.5, or 4.6 NOT detected. Please install before
echo using this script. If already installed, something may be 'wrong'...
goto :fin
 
 
:line
echo ____________________________________________________________________________
goto :eof

Всего записей: 1419 | Зарегистр. 11-11-2008 | Отправлено: 18:19 01-01-2018 | Исправлено: Maxim_um, 18:20 01-01-2018
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Microsoft .NET | .NET Framework


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru