-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset-up_and_join_domain.bat
145 lines (133 loc) · 4.5 KB
/
set-up_and_join_domain.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
@ECHO OFF
SET dir_home=%~dp0
goto selection
:selection
color 2
cls
ECHO.
ECHO Welcome to the KCS setup utility, your computer info:
ECHO.
wmic computersystem get model,name,manufacturer,systemtype,domain
ECHO Welcome to the ORGANIZATION NAME setup utility, you're making changes to %computername%
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO 1) Join Domain
ECHO 2) Enable Wake-on-LAN
ECHO 3) Install LANschool
ECHO 4) Automate Shutdown
ECHO 5) Shutdown
ECHO 6) Exit
ECHO.
ECHO M for more options
ECHO.
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO.
SET /P option="What would you like to do: "
if %option% == 1 (goto domain)
if %option% == 2 (goto wol)
if %option% == 3 (goto lanschool)
if %option% == 4 (goto autoshutdown)
if %option% == 5 shutdown /s /f /t 0
if %option% == 6 EXIT
if %option% == m (goto options)
if %option% == M (goto options)
ECHO.
ECHO Unknown value
pause
goto selection
:domain
cls
ECHO.
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO Running Powershell script to join to Domain
Powershell.exe -ExecutionPolicy Unrestricted -File %dir_home%\domain_super_pally_script_9000.ps1
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO.
PAUSE
goto selection
:wol
cls
ECHO.
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO Installing WOL features
Powershell.exe -ExecutionPolicy Unrestricted -File %dir_home%\WOL_enabler.ps1
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO.
PAUSE
goto selection
:lanschool
cls
ECHO.
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO Installing LANschool
SET /P channel="channel number: "
Msiexec.exe /i %dir_home%\student.msi /passive ADVANCED_OPTIONS=1 STEALTH_MODE=1 CHANNEL=%channel%
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO.
PAUSE
goto selection
:autoshutdown
cls
ECHO.
ECHO ----------------------------------------------------------------------------------------------------------------------
ECHO Format example: 18:00
ECHO ----------------------------------------------------------------------------------------------------------------------
SET /P time="Shutdown time:"
schtasks /create /sc daily /tn "auto shutdown my computer daily" /tr "shutdown -s" /st %time%
PAUSE
goto selection
:options
color 4
cls
ECHO.
ECHO **********************************************************************************************************************
ECHO 1) Rename computer
ECHO 2) Scan for problems
ECHO 3) How long have I been left on?
ECHO 4) Stop shutdown
ECHO.
ECHO B to go back
ECHO.
ECHO *********************************************************************************************************************
ECHO .
SET /P option="What would you like to do: "
if %option% == 1 (goto rename)
if %option% == 2 (goto troubleshoot)
if %option% == 3 (goto bootime)
if %option% == 4 shutdown /a
if %option% == B (goto selection)
if %option% == b (goto selection)
ECHO.
ECHO Unknown value
pause
goto options
:rename
cls
ECHO.
ECHO **********************************************************************************************************************
ECHO Rename will happen after restart
ECHO **********************************************************************************************************************
ECHO.
ECHO Current name: %computername%
SET /P newname="New name: "
WMIC computersystem where caption='%computername%' rename %newname%
ECHO.
PAUSE
goto options
:troubleshoot
cls
ECHO.
ECHO **********************************************************************************************************************
sfc /scannow
ECHO **********************************************************************************************************************
ECHO.
PAUSE
goto options
:bootime
cls
ECHO.
ECHO **********************************************************************************************************************
systeminfo | find "Boot Time"
ECHO **********************************************************************************************************************
ECHO.
PAUSE
goto options