-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtinyOS 1.0.bat
More file actions
176 lines (157 loc) · 3.47 KB
/
tinyOS 1.0.bat
File metadata and controls
176 lines (157 loc) · 3.47 KB
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
@echo off
title TinyOS 1.0
color A
cls
REM ================================
REM Project Notes
REM Author: Minh
REM Date: 2025-09-28
REM
REM This script mimics macOS and runs in cmd
REM Github repo: github.com/minh6079/tinyOS.git
REM ================================
:: Set the initial password
set password=tinyOS
:logon
color A
cls
echo Please logon first
set /p pass=Enter password:
if "%pass%"=="%password%" (
cls
goto menu
)
color C
echo Incorrect password, please try again.
pause
cls
goto logon
:menu
echo Welcome to TinyOS 1.0! - The 4KB OS Emulator
echo ========================================
echo [1] Create file
echo [2] Create folder
echo [3] Move file
echo [4] Copy file
echo [5] Delete folder
echo [6] Format progress (just for fun)
echo [7] List files and folders
echo [8] Restart
echo [9] Shutdown
echo [10] Change password
echo [11] Log out
echo [12] Reset password
echo ========================================
set /p choice=Enter option:
:: Handling user choices
if "%choice%"=="1" goto createFile
if "%choice%"=="2" goto createFolder
if "%choice%"=="3" goto moveFile
if "%choice%"=="4" goto copyFile
if "%choice%"=="5" goto deleteFolder
if "%choice%"=="6" goto formatProgress
if "%choice%"=="7" goto tree
if "%choice%"=="8" goto restartSystem
if "%choice%"=="9" goto shutdownSystem
if "%choice%"=="10" goto changePassword
if "%choice%"=="11" goto logOut
if "%choice%"=="12" goto resetPassword
:: If input is invalid, print an error message
color C
echo Error! Invalid choice. Try again.
pause
color A
cls
goto menu
:createFile
set /p filename=Enter file name (with extension):
echo. > "%filename%"
echo File "%filename%" created successfully!
pause
cls
goto menu
:createFolder
set /p foldername=Enter folder name:
mkdir "%foldername%"
echo Folder "%foldername%" created successfully!
pause
cls
goto menu
:moveFile
set /p source=Enter source file path:
set /p destination=Enter destination folder path:
move "%source%" "%destination%"
echo File moved successfully!
pause
cls
goto menu
:copyFile
set /p source=Enter source file path:
set /p destination=Enter destination folder path:
copy "%source%" "%destination%"
echo File copied successfully!
pause
cls
goto menu
:deleteFolder
set /p folderdel=Enter folder name to delete:
rmdir /S /Q "%folderdel%"
echo Folder "%folderdel%" deleted successfully!
pause
cls
goto menu
:formatProgress
echo Formatting in progress...
for /L %%i in (0,10,100) do (
echo Formatting %%i%%...
ping -n 2 localhost >nul
)
echo Format complete! (Just for fun :) )
pause
cls
goto menu
:tree
tree /f
echo Listing complete
pause
cls
goto menu
:restartSystem
cls
echo Restarting system...
ping -n 3 localhost > nul
cls
goto logon
:shutdownSystem
cls
echo Are you sure you want to shut down? (Y/N)
set /p confirm=Choice:
if /I "%confirm%"=="Y" (
echo Shutting down in 3...
ping -n 2 localhost > nul
echo Shutting down in 2...
ping -n 2 localhost > nul
echo Shutting down in 1...
ping -n 2 localhost > nul
exit
)
goto menu
:changePassword
cls
echo Change Password
echo ================
set /p newpass=Enter new password:
set password=%newpass%
echo Password changed successfully!
pause
cls
goto menu
:logOut
cls
echo Logging out...
:resetPassword
set password=tinyOS
echo Password has been reset to the default ("tinyOS")
pause
cls
goto logon