-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu2.cmd
More file actions
224 lines (174 loc) · 3.3 KB
/
Copy pathmenu2.cmd
File metadata and controls
224 lines (174 loc) · 3.3 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
@echo OFF
title "Menu 2"
:main
cd C:\Users\mickey\Desktop\scripts\batch
echo "~~~~~~~~~~~~~~~~~~~~~"
echo " FOLDER A - M E N U"
echo "~~~~~~~~~~~~~~~~~~~~~"
echo 1 - Open File:
echo 2 - Copy/Move File:
echo 3 - Rename File:
echo 4 - Rename multiple file extensions
echo 5 - Remove file:
echo 6 - exit
rem user input variable
set /p menuInput2=
if "%menuInput2%"=="1" (
goto one
)
if "%menuInput2%"== "2" (
goto two
)
if "%menuInput2%"== "3" (
goto three
)
if "%menuInput2%" == "4" (
goto four
)
if "%menuInput2%" == "5" (
goto five
)
if "%menuInput2%"=="6" (
goto six
) else (
goto end
)
rem Open Files
:one
cls
echo "choose a File to open from the list below"
echo.
cd "C:\Users\mickey\Desktop\scripts\batch\A"
rem this will just print files none of the other rubish
dir /b
echo.
echo "Please enter the file to open followed by the extension"
echo.
set /p read=
rem if stement that will ask the user to
rem type the name of the file they want to open then store
rem the name in the read variable and use the exist cmd to check if the file exists
if exist "%read%" (
pause
echo That file is there and is a directory
start %read%
dir /b
cls
echo "%read%" "has been successfully opened"
pause
cls
) else (
echo "Not there or not a directory"
cls
cd C:\Users\mickey\Desktop\scripts\batch
goto end
cls
)
cls
goto end
REM COPY/ MOVE FILES
:two
set myPath=C:\Users\mickey\Desktop\scripts\batch\B
cls
echo "Choose a File to Copy/Move to Folder B"
echo.
cd C:\Users\mickey\Desktop\scripts\batch\A
dir /b
echo "Please eneter file name:"
echo.
set /p copy=
pause
if exist "%copy%" (
copy "%copy%" "%myPath%"
cls
dir /b
echo.
echo "%copy% has been successfully copied to folder B"
pause
start C:\Users\mickey\Desktop\scripts\batch\B
cls
) else (
echo "Not there or not a directory"
cls
cd C:\Users\mickey\Desktop\scripts\batch
goto end
cls
)
cls
cd C:\Users\mickey\Desktop\scripts\batch
goto end
rem RENAME FILE
:three
cls
pause
echo "Choose a File to Rename"
cls
cd C:\Users\mickey\Desktop\scripts\batch\A
dir /b
echo.
echo "Please enter the file name"
set /p rename=
echo.
echo "Please enter the new name"
set /p new=
if exist "%rename%" (
move "%rename%" "%new%"
echo "Your file has been renamed"
cls
dir /b
start C:\Users\mickey\Desktop\scripts\batch\A
pause
) else (
echo "File can't be renamed"
)
goto end
rem rename multiple extensions
:four
cls
echo "The jpg files in folder jpg will all be changed to an image extension of your choice. Example png"
echo.
echo Enter the file extension
set /p read=
cd C:\Users\mickey\Desktop\scripts\batch\jpg
dir /b
pause
ren *.jpg *."%read%"
cls
dir /b
pause
cd ..
goto end
rem remove files
:five
cls
echo "Choose a file to delete"
cd C:\Users\mickey\Desktop\scripts\batch\A
echo.
dir /b
echo.
echo "Please enter the file you want to delete"
set /p delete=
if exist "%delete%" (
del "%delete%"
cls
echo %delete% has been sucessfully removed
cd.
dir /b
cd ..
pause
goto end
) else (
echo %delete% does not exist, please try again
)
cls
cd ..
goto end
rem EXIT
:six
cls
call mainMenu.cmd
goto end
:end
cls
call menu2.cmd
cls