-
Автор темы
- #1
Хай зяблс, прошу помощи, пытался написать батник для установки всего софта с диска автоматической с сайлентом, т.к последнее время часто перебиваю винду.
Бьет ошибки.
Ни разу не имел дел с батниками и автоматизацией таким способом в принципе, гугление результатов не дало.
Ставит только редисты от майков, дело до другого софта не доходит.
Аргументы на сайлент установку вроде как правильные.
Прошу помощи в фиксе, спасибо.
Бьет ошибки.
Ни разу не имел дел с батниками и автоматизацией таким способом в принципе, гугление результатов не дало.
Ставит только редисты от майков, дело до другого софта не доходит.
Прошу помощи в фиксе, спасибо.
xd:
[USER=45966]@Echo[/USER] off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting Admin...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
set IS_X64=0 && if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set IS_X64=1) else (if "%PROCESSOR_ARCHITEW6432%"=="AMD64" (set IS_X64=1))
if "%IS_X64%" == "1" goto X64
echo Automatically installation.
echo ALERT! All software need manually/automatically update !
echo ALERT! Don't forget disable Win10 Defender/Xbox overlay/Windows Update !
echo Disable UAC...
reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
echo Disable HideFileExtensions...
reg.exe ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f
echo Disable SmartScreen...
reg.exe ADD HKLM\Policies\Microsoft\Windows\System /v EnableSmartScreen /t REG_DWORD /d 0 /f
echo Disable Win10 FireWall [Domain/Profile/Public]...
netsh advfirewall set allprofiles state off
echo Toogle hidden files...
"E:\Install\Programs after reinstalling Windows\Main package\ToogleHiddenFiles.reg" /S /norestart
echo ClassicShell...
"E:\Install\Programs after reinstalling Windows\Main package\ClassicShellSetup_4_3_1.exe" /S /norestart
echo Discord...
"E:\Install\Programs after reinstalling Windows\Main package\DiscordSetup.exe" /S /norestart
echo KeePass...
"E:\Install\Programs after reinstalling Windows\Main package\KeePass-2.48.1-Setup.exe" /S /norestart
echo Notepad...
"E:\Install\Programs after reinstalling Windows\Main package\npp.7.8.4.Installer.exe" /S /norestart
echo ShareX...
"E:\Install\Programs after reinstalling Windows\Main package\ShareX-13.0.1-setup.exe" /S /norestart
echo TMACv6 Changer...
"E:\Install\Programs after reinstalling Windows\Main package\TMACv6.0.7_Setup.exe" /S /norestart
echo Vivaldi Browser...
"E:\Install\Programs after reinstalling Windows\Main package\Vivaldi.2.10.1745.27.x64.exe" /S /norestart
echo WinRAR...
"E:\Install\Programs after reinstalling Windows\Main package\winrar-x64-611ru.exe" /S /norestart
echo Spotify...
"E:\Install\Programs after reinstalling Windows\Main package\Spotify\SpotifySetup.exe" /S /norestart
echo Toastify...
"E:\Install\Programs after reinstalling Windows\Main package\Spotify\ToastifyInstaller.exe" /S /norestart
echo DirectX...
"E:\Install\Programs after reinstalling Windows\Main package\DirectX\DXSETUP.exe" /S /norestart
echo Microsoft Visual C++ Redist 2015-2022 [June] #1...
"E:\Install\Programs after reinstalling Windows\Main package\Drivers c++\c++ repak.exe" /S /norestart
echo DirectX7...
"E:\Install\Programs after reinstalling Windows\Main package\Drivers c++\DX7.exe" /S /norestart
echo Starting installing C++/VCRedist [October/November] #2
echo 2005...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2005_x86.exe" /S /norestart
echo 2008...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2008_x86.exe" /S /norestart
echo 2010...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2010_x86.exe" /S /norestart
echo 2012...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2012_x86.exe" /S /norestart
echo 2013...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2013_x86.exe" /S /norestart
echo 2015, 2017 ^& 2019...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2015_2017_2019_x86.exe" /S /norestart
goto END
:X64
echo 2005...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2005_x86.exe" /S /norestart
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2005_x64.exe" /S /norestart
echo 2008...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2008_x86.exe" /S /norestart
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2008_x64.exe" /S /norestart
echo 2010...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2010_x86.exe" /S /norestart
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2010_x64.exe" /S /norestart
echo 2012...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2012_x86.exe" /S /norestart
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2012_x64.exe" /S /norestart
echo 2013...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2013_x86.exe" /S /norestart
start /wait "D:\Install\Programs after reinstalling Windows\Main package\vcredist2013_x64.exe" /S /norestart
echo 2015, 2017 ^& 2019 ^& 2022...
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2015_2017_2019_2022_x86.exe" /S /norestart
"E:\Install\Programs after reinstalling Windows\Main package\vcredist2015_2017_2019_2022_x64.exe" /S /norestart
goto END
:END
echo.
echo Installation completed successfully
pause
Последнее редактирование: