-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwritable.bat
More file actions
94 lines (77 loc) · 1.97 KB
/
writable.bat
File metadata and controls
94 lines (77 loc) · 1.97 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
@ECHO OFF
:choose
cls
set /p choose= Would you like to go to an existing batch file or make a new one? (New/Exist)
if %choose% == Exist goto existfile
if %choose% == New goto new
:existfile
set /p exist= Type your batch file's name (with extension)
goto check
:check
echo CHECKING IF FILE EXISTS...
ping -n 2 localhost >nul
if exist %exist% goto successfile
if not exist %exist% goto failfile
:failfile
echo ERROR: File does NOT exist.
ping -n 2 localhost >nul
goto choose
:successfile
echo SUCCESS! File Exists!
ping -n 2 localhost >nul
goto typetwo
:new
cls
SET /P FileName=Enter the name for the new batch file (without extension):
goto checkfile
:checkfile
cls
echo Checking if %FileName%.bat Exists...
ping -n 2 localhost >nul
if exist %FileName%.bat goto already
if not exist %FileName%.bat goto noalready
:noalready
echo %FileName%.bat does not exist. Continuing...
ping -n 2 localhost >nul
goto type
:already
echo ERROR: %FileName%.bat already exists!
ping -n 2 localhost >nul
goto new
:type
ECHO @ECHO OFF > %FileName%.bat
set /p type= What would you like to type in %FileName%.bat? (If it crashes, its not my fault)
ping -n 2 localhost >nul
echo WRITING...
ECHO %type% >> %FileName%.bat
ping -n 2 localhost >nul
echo SUCCESS!
ping -n 2 localhost >nul
goto ques
:ques
cls
set /p more= Would you like to type a new line? (Y/N)
if %more% == Y goto type
if %more% == N goto success
:typetwo
set /p type= What would you like to type in %exist%? (If it crashes, its not my fault)
ping -n 2 localhost >nul
echo WRITING...
ECHO %type% >> %Exist%
ping -n 2 localhost >nul
echo SUCCESS!
ping -n 2 localhost >nul
goto ques
:questwo
cls
set /p more= Would you like to type a new line? (Y/N)
if %more% == Y goto typetwo
if %more% == N goto successtwo
:successtwo
cls
ECHO New batch file %Exist%.bat created successfully.
PAUSE
:success
cls
ECHO New batch file %FileName%.bat created successfully.
PAUSE