-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.bat
101 lines (91 loc) · 1.95 KB
/
start.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
@echo off
title System Control Script
color 1E
:main
cls
echo ===========================
echo System Control Menu
echo ===========================
echo.
echo [1] Shutdown
echo [2] Reboot
echo [3] Log out
echo [4] Cancel Shutdown
echo [5] Calculator (in sec)
echo ===========================
echo.
set /p "choice=Choose an option: "
if '%choice%'=='1' goto shutdown
if '%choice%'=='2' goto reboot
if '%choice%'=='3' goto logout
if '%choice%'=='4' goto cancel
if '%choice%'=='5' goto calculator
color 4F
echo Invalid option. Please enter a number between 1 and 5.
pause
goto main
:shutdown
color 2E
cls
echo ===========================
echo Shutdown Setup
echo ===========================
set /p "time=Shutdown time in seconds: "
echo Time until shutdown: %time% seconds
echo.
echo "Please save all open files!"
shutdown -s -f -t %time%
pause
goto main
:reboot
color 5E
cls
echo ===========================
echo Reboot Setup
echo ===========================
set /p "time=Reboot time in seconds: "
echo The computer will reboot in %time% seconds.
shutdown -r -t %time%
pause
goto main
:logout
color 3E
shutdown -l
goto main
:cancel
color 6E
shutdown -a
echo Shutdown cancelled.
pause
goto main
:calculator
cls
color 1F
echo ===========================
echo Time Conversion
echo ===========================
echo [1] Hours to seconds
echo [2] Minutes to seconds
echo ===========================
set /p "choice2=Choose an option: "
if '%choice2%'=='1' goto hours
if '%choice2%'=='2' goto minutes
goto main
:hours
color 3F
cls
echo Enter the number of hours:
set /p "hours=Hours: "
set /a seconds=%hours%*3600
echo %hours% hours are %seconds% seconds.
pause
goto main
:minutes
color 3F
cls
echo Enter the number of minutes:
set /p "minutes=Minutes: "
set /a seconds=%minutes%*60
echo %minutes% minutes are %seconds% seconds.
pause
goto main