-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtinyOS 4.0.bat
More file actions
528 lines (494 loc) Β· 22.5 KB
/
tinyOS 4.0.bat
File metadata and controls
528 lines (494 loc) Β· 22.5 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
@echo off
chcp 65001 >nul
title TinyOS
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 textMode
)
color C
echo Incorrect password, please try again.
pause
cls
goto logon
:: Text Mode Menu (starts here)
:textMode
color A
cls
echo Welcome to TinyOS! - The 23KB 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 [13] Enter GUI mode
echo ========================================
set /p choice=Enter option:
:: Handling user choices
if "%choice%"=="1" goto createFileText
if "%choice%"=="2" goto createFolderText
if "%choice%"=="3" goto moveFileText
if "%choice%"=="4" goto copyFileText
if "%choice%"=="5" goto deleteFolderText
if "%choice%"=="6" goto formatProgressText
if "%choice%"=="7" goto treeText
if "%choice%"=="8" goto restartSystemText
if "%choice%"=="9" goto shutdownSystemText
if "%choice%"=="10" goto changePasswordText
if "%choice%"=="11" goto logOutText
if "%choice%"=="12" goto resetPasswordText
if "%choice%"=="13" goto gui
:: If input is invalid, print an error message
color C
echo Error! Invalid choice. Try again.
pause
color A
cls
goto textMode
:: Function for text-based file creation
:createFileText
set /p filename=Enter file name (with extension):
echo. > "%filename%"
echo File "%filename%" created successfully!
pause
cls
goto textMode
:: Function for folder creation
:createFolderText
set /p foldername=Enter folder name:
mkdir "%foldername%"
echo Folder "%foldername%" created successfully!
pause
cls
goto textMode
:: Function for moving files
:moveFileText
set /p source=Enter source file path:
set /p destination=Enter destination folder path:
move "%source%" "%destination%"
echo File moved successfully!
pause
cls
goto textMode
:: Function for copying files
:copyFileText
set /p source=Enter source file path:
set /p destination=Enter destination folder path:
copy "%source%" "%destination%"
echo File copied successfully!
pause
cls
goto textMode
:: Function for deleting folders
:deleteFolderText
set /p folderdel=Enter folder name to delete:
rmdir /S /Q "%folderdel%"
echo Folder "%folderdel%" deleted successfully!
pause
cls
goto textMode
:: Function for format progress animation
:formatProgressText
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 textMode
:: Function for listing files and folders
:treeText
tree /f
echo Listing complete
pause
cls
goto textMode
:: Function for restarting the system (simulation)
:restartSystemText
cls
echo Restarting system...
ping -n 3 localhost > nul
cls
goto logon
:: Function for shutting down the system
:shutdownSystemText
cls
echo Are you sure you want to shut down? (Y/N)
set /p confirm=Choice:
if /I "%confirm%"=="Y" exit
cls
goto textMode
:: Function for changing the password
:changePasswordText
cls
echo Change Password
echo ================
set /p newpass=Enter new password:
set password=%newpass%
echo Password changed successfully!
pause
cls
goto textMode
:: Function for logging out
:logOutText
cls
echo Logging out...
pause
goto logon
:: Function for resetting the password to default
:resetPasswordText
set password=tinyOS
echo Password has been reset to the default ("tinyOS")
pause
cls
goto logon
:: GUI Mode (starts here)
:gui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
echo.
echo [1] Create file π
echo [2] Create folder π
echo [3] Move file π€
echo [4] Copy file π
echo [5] Delete folder π
echo [6] Format (fun) π½
echo [7] List files π
echo [8] Restart π
echo [9] Shutdown β»
echo [10] Change password π
echo [11] Log out π
echo [12] Reset password π£
echo [13] Return to text mode π
echo.
set /p choice=Enter option:
if "%choice%"=="1" goto createFileGui
if "%choice%"=="2" goto createFolderGui
if "%choice%"=="3" goto moveFileGui
if "%choice%"=="4" goto copyFileGui
if "%choice%"=="5" goto deleteFolderGui
if "%choice%"=="6" goto formatProgressGui
if "%choice%"=="7" goto treeGui
if "%choice%"=="8" goto restartSystemGui
if "%choice%"=="9" goto shutdownSystemGui
if "%choice%"=="10" goto changePasswordGui
if "%choice%"=="11" goto logOutGui
if "%choice%"=="12" goto resetPasswordGui
if "%choice%"=="13" goto textMode
:: If input is invalid, print an error message
color C
echo Error! Invalid choice. Try again.
pause
color A
goto gui
:: Function for text-based file creation in Gui
:createFileGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Create New File ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| File Name: [____________________] ^|
echo. ^| File Type: [ .txt βΌ ] ^|
echo. ^|--------------------------------------^|
echo. ^| [ Create ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo.
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
set /p filename=Enter file name (with extension):
echo. > "%filename%"
echo File "%filename%" created successfully!
pause
cls
goto gui
:: Function for folder creation in Gui
:createFolderGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Create New Folder ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| Folder Name: [____________________] ^|
echo. ^| Folder Location [ Desktop βΌ ] ^|
echo. ^|--------------------------------------^|
echo. ^| [ Create ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo.
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
set /p foldername=Enter folder name:
mkdir "%foldername%"
echo Folder "%foldername%" created successfully!
pause
cls
goto gui
:: Function for moving files in Gui
:moveFileGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Move File ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| File Name: [ ___________ ] ^|
echo. ^| Current Location: [ ________βΌ ] ^|
echo. ^| New Location: [ _______ βΌ ] ^|
echo. ^|--------------------------------------^|
echo. ^| [ Move ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
set /p source=Enter source file path:
set /p destination=Enter destination folder path:
move "%source%" "%destination%"
echo File moved successfully!
pause
cls
goto gui
:: Function for copying files
:copyFileGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Copy File ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| File Name: [ ___________ ] ^|
echo. ^| Source Location: [ _________ βΌ ] ^|
echo. ^| Destination: [ _______ βΌ ] ^|
echo. ^|--------------------------------------^|
echo. ^| [ Copy ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
set /p source=Enter source file path:
set /p destination=Enter destination folder path:
copy "%source%" "%destination%"
echo File copied successfully!
pause
cls
goto gui
:: Function for deleting folders
:deleteFolderGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Delete Folder ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| β οΈ Are you sure you want to delete ^|
echo. ^| the folder "____________"? ^|
echo. ^| ^|
echo. ^| This action cannot be undone. ^|
echo. ^|--------------------------------------^|
echo. ^| [ Delete ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
set /p folderdel=Enter folder name to delete:
rmdir /S /Q "%folderdel%"
echo Folder "%folderdel%" deleted successfully!
pause
cls
goto gui
:: Function for format progress animation
:formatProgressGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Format Drive ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| Select Drive: [ Macintosh HD βΌ ] ^|
echo. ^| File System: [ APFS βΌ ] ^|
echo. ^| Volume Name: [ NewDrive ] ^|
echo. ^|--------------------------------------^|
echo. ^| β οΈ Formatting will erase all data. ^|
echo. ^| Proceed with caution. ^|
echo. ^|--------------------------------------^|
echo. ^| [ Format ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
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 gui
:: Function for listing files and folders
:treeGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Files List ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| Files and folders listed below... ^|
echo. ^|--------------------------------------^|
echo. ^| [ Back ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
tree /f
echo Listing complete
pause
cls
goto gui
:: Function for restarting the system (simulation)
:restartSystemGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Restart System ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| β οΈ Are you sure you want to restart? ^|
echo. ^| All unsaved changes will be lost. ^|
echo. ^|--------------------------------------^|
echo. ^| [ Restart ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
echo Restarting system...
ping -n 3 localhost > nul
cls
goto logon
:: Function for shutting down the system
:shutdownSystemGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Shut down System ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^|β οΈ Are you sure you want to shut down?^|
echo. ^| All unsaved changes will be lost. ^|
echo. ^|--------------------------------------^|
echo. ^| [ Shut down ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
echo Are you sure you want to shut down? (Y/N)
set /p confirm=Choice:
if /I "%confirm%"=="Y" exit
cls
goto gui
:: Function for changing the password
:changePasswordGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Change Password ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^| Current Password: [______________] ^|
echo. ^| New Password: [______________] ^|
echo. ^|--------------------------------------^|
echo. ^| [ Change Password ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
echo Change Password
echo ================
set /p newpass=Enter new password:
set password=%newpass%
echo Password changed successfully!
pause
cls
goto gui
:: Function for logging out
:logOutGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Log out System ^|βοΈ^|
echo. ^|--------------------------------------^|
echo. ^|β οΈ Are you sure you want to log out? ^|
echo. ^| All unsaved changes will be lost. ^|
echo. ^|--------------------------------------^|
echo. ^| [ Log out ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
echo Logging out...
pause
goto logon
:: Function for resetting the password to default
:resetPasswordGui
cls
echo π Finder File View Edit Go Help π %time:~0,5% %date:~7,2%/%date:~4,2%/%date:~10,4%
echo _________________________________________________________________________________________________
echo. ______________________________________
echo. ^| π₯οΈ macOS - Confirmation ^|βοΈ^|
echo. ^| β οΈ Are you sure you want to proceed? ^|
echo. ^| This action cannot be undone. ^|
echo. ^|--------------------------------------^|
echo. ^| [ Confirm ] [ Cancel ] ^|
echo. ^|______________________________________^|
echo.
echo. ____________________________________________________
echo ^| π π π€ π π π½ π π β» π π π£ ^|
echo ^|____________________________________________________^|
set password=tinyOS
echo Password has been reset to the default ("tinyOS")
pause
cls
goto logon