-
Notifications
You must be signed in to change notification settings - Fork 0
/
toolkitdownloader.bat
80 lines (59 loc) · 3.35 KB
/
toolkitdownloader.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@echo off
cls
echo Downloading toolkit, please wait. . .
goto download_all
mkdir toolkit & cd toolkit
mkdir hardtools
mkdir nettools
mkdir wintools
:download_os
bitsadmin /transfer overscript /download /priority normal https://github.com/pieterhouwen/scripts/tree/master/overscript.bat overscript.bat 2>overscript_log.log 1>nul
if %errorlevel% NEQ 0 goto download_error_os
:download_mb
bitsadmin /transfer motherboard /download /priority normal https://github.com/pieterhouwen/scripts/tree/master/hardtools/motherboard.bat hardtools\motherboard.bat 2>motherboard_log.log 1>nul
if %errorlevel% NEQ 0 goto download_error_mb
:download_or
bitsadmin /transfer outlookreset /download /priority normal https://github.com/pieterhouwen/scripts/tree/master/wintools/outlookreset.bat wintools\outlookreset.bat 2>outlookreset_log.log 1>nul
if %errorlevel% NEQ 0 goto download_error_or
:download_bc
bitsadmin /transfer BCDedit /download /priority normal https://github.com/pieterhouwen/scripts/tree/master/wintools/bcdedit.bat wintools\bcdedit.bat 2>bcdedit_log.log 1>nul
if %errorlevel% NEQ 0 goto download_error_bc
:download_sd
bitsadmin /transfer ShowDrives /download /priority normal https://github.com/pieterhouwen/scripts/tree/master/wintools/showdrives wintools\showdrives.bat 2>showdrives_log.log 1>nul
if %errorlevel% NEQ 0 goto download_error_sd
REM ERRORS
:download_error_os
echo Overscript failed to download, trying another method.
powershell.exe -command (new-object System.Net.WebClient).DownloadFile('https://github.com/pieterhouwen/scripts/tree/master/overscript.bat', '$Env:temp\overscript.bat')
if errorlevel NEQ 0 goto download_error_2
copy %temp%\overscript.bat .
goto download_mb
pause
:download_error_mb
echo Motherboard failed to download, trying another method.powershell.exe -command (new-object System.Net.WebClient).DownloadFile('https://github.com/pieterhouwen/scripts/tree/master/motherboard.bat', '$Env:temp\motherboard.bat')
powershell.exe -command (new-object System.Net.WebClient).DownloadFile('https://github.com/pieterhouwen/scripts/tree/master/hardtools/motherboard.bat', '$Env:temp\motherboard.bat')
if errorlevel NEQ 0 goto download_error_2
copy %temp%\motherboard.bat hardtools\motherboard.bat
goto download_or
pause
:download_error_or
echo Outlokreset failed to download, trying another method.
powershell.exe -command (new-object System.Net.WebClient).DownloadFile('https://github.com/pieterhouwen/scripts/tree/master/wintools/outlookreset.bat', '$Env:temp\outlookreset.bat')
if errorlevel NEQ 0 goto download_error_2
copy %temp%\outlookreset.bat wintools\outlookreset.bat
:download_error_2
echo Something went wrong again, please check the output.
pause
exit
:Download_all
mode 500
mkdir %temp%\toolkit %temp%\toolkit\hardtools %temp%\toolkit\wintools %temp%\toolkit\nettools
REM Root files
call nettools\download2.bat OverScript https://github.com/pieterhouwen/scripts/tree/master/overscript.bat %temp%\toolkit\overscript.bat
pause
REM Hardware files
call nettools\download2.bat Motherboard https://github.com/pieterhouwen/scripts/tree/master/hardtools/motherboard.bat %temp%\toolkit\hardtools\motherboard.bat
pause
REM Windows Tools
call nettools\download2.bat OutlookReset https://github.com/pieterhouwen/scripts/tree/master/wintools/outlookreset.bat %temp%\toolkit\wintools\outlookreset.bat
pause