-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrive2drive.frm
434 lines (372 loc) · 11.7 KB
/
drive2drive.frm
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
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
Caption = "Ez Unace"
ClientHeight = 6090
ClientLeft = 45
ClientTop = 330
ClientWidth = 6060
Icon = "DRIVE2~1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 6090
ScaleWidth = 6060
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command3
Caption = "&New Folder"
Height = 255
Left = 3480
TabIndex = 15
Top = 4440
Width = 2415
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 285
Left = 3480
TabIndex = 14
Text = "Type new folder name here"
Top = 3960
Width = 2415
End
Begin VB.Timer Timer1
Interval = 500
Left = 3000
Top = 3600
End
Begin VB.CheckBox Check1
BackColor = &H00000000&
Caption = "View only *.ace file in Directory"
ForeColor = &H00FFFFFF&
Height = 375
Left = 120
TabIndex = 12
Top = 4200
Width = 2535
End
Begin VB.CommandButton Command1
Caption = "&Extract"
Height = 375
Left = 4800
TabIndex = 11
Top = 5040
Width = 975
End
Begin VB.OptionButton Option2
BackColor = &H00000000&
Caption = "All ace files"
ForeColor = &H00FFFFFF&
Height = 375
Left = 240
MaskColor = &H00FFFFFF&
TabIndex = 8
Top = 5520
Value = -1 'True
Width = 1575
End
Begin VB.OptionButton Option1
BackColor = &H00000000&
Caption = "Selected Files"
ForeColor = &H00FFFFFF&
Height = 375
Left = 240
MaskColor = &H00FFFFFF&
TabIndex = 7
Top = 5040
Width = 1335
End
Begin VB.CommandButton exit
BackColor = &H00C0C0C0&
Caption = "E&xit"
Height = 375
Left = 4800
MaskColor = &H00400000&
TabIndex = 5
Top = 5520
Width = 975
End
Begin VB.DirListBox Dir2
BackColor = &H00FFFFFF&
Height = 2565
Left = 3480
TabIndex = 4
Top = 720
Width = 2415
End
Begin VB.DriveListBox Drive2
BackColor = &H00FFFFFF&
Height = 315
Left = 3480
TabIndex = 3
Top = 360
Width = 2415
End
Begin VB.FileListBox File1
BackColor = &H00FFFFFF&
Height = 870
Left = 120
MultiSelect = 2 'Extended
TabIndex = 2
Top = 3360
Width = 2415
End
Begin VB.DirListBox Dir1
BackColor = &H00FFFFFF&
Height = 2565
Left = 120
TabIndex = 1
Top = 720
Width = 2415
End
Begin VB.DriveListBox Drive1
BackColor = &H00FFFFFF&
Height = 315
Left = 120
TabIndex = 0
Top = 360
Width = 2415
End
Begin VB.Label Label4
BackColor = &H00000000&
ForeColor = &H00FFFFFF&
Height = 495
Left = 3480
TabIndex = 16
Top = 3360
Width = 2415
End
Begin VB.Label Label5
BackColor = &H00000000&
Caption = "Dos instruction view"
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Left = 120
TabIndex = 13
Top = 4560
Width = 2775
End
Begin VB.Shape Shape1
BorderColor = &H00FFFFFF&
Height = 1095
Left = 120
Shape = 4 'Rounded Rectangle
Top = 4920
Width = 5775
End
Begin VB.Line Line1
BorderColor = &H00FFFFFF&
X1 = 3000
X2 = 3000
Y1 = -600
Y2 = 4920
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H00000000&
Caption = "[ Extract to ]"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 3840
TabIndex = 10
Top = 0
Width = 1575
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00000000&
Caption = "[ From ]"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 480
TabIndex = 9
Top = 0
Width = 1575
End
Begin VB.Label Label1
BackColor = &H00000000&
Caption = "Brought to you by Rico.Select the ace file you want to extract and also if all files or selected file must be extracted."
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 855
Left = 1800
TabIndex = 6
Top = 5040
Width = 2895
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTotalNumberOfClusters As Long) As Long
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Dim acename As String
Dim b As String
Private Sub Check1_Click()
If Check1.Value = 1 Then
File1.Pattern = "*.ace"
Else
File1.Pattern = "*.*"
End If
End Sub
Private Sub Command1_Click()
'Write instruction
Label5.Caption = "ace" & " x" & " -r " & acename & " " & b & " " & Dir2.Path
'Write as batch file
Dim fileno As Integer
fileno = FreeFile
Open "ezunace.bat" For Append As fileno
Print #fileno, Label5.Caption
Print #fileno, "cls"
Print #fileno, "@Echo Unace complete....Ez Unace brought to you by Rico visit Black Sun at www.angelfire.com/sc/blacksun"
Print #fileno, "del ezunace.bat"
Print #fileno, "exit"
Close fileno
'Run batch file and unace
Shell "ezunace.bat"
'Finished with everything
MsgBox "You can close this program now but let the batchfile run to completion.", vbInformation
End Sub
Private Sub Command3_Click()
If Text1.Text = "Type new folder name here" Then
MsgBox "Enter new directory name.", vbExclamation
ElseIf Dir2.Path = Drive2.Drive + "\" Then
MkDir Dir2.Path & Text1.Text
Dir2.Refresh
Dir2.Path = Dir2.Path & Text1.Text
Text1.Text = ""
Else
MkDir Dir2.Path & "\" & Text1.Text
Dir2.Refresh
Dir2.Path = Dir2.Path & "\" & Text1.Text
Text1.Text = ""
End If
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
File1.Refresh
End Sub
Private Sub Drive1_Change()
On Error GoTo DriveError
Dir1.Path = Drive1.Drive
Exit Sub
DriveError:
MsgBox "Device Not Ready!", vbExclamation, "Error"
Drive1.Drive = Dir1.Path
Exit Sub
Dir1.Refresh
End Sub
Private Sub Drive2_Change()
Dim freespace As String
On Error GoTo DriveError
'Check free disk Space
drivename = Drive2.Drive
x = GetDiskFreeSpace(Drive2.Drive & "\", secperclus, byteperclus, freeclus, totalclus)
freespace = secperclus * byteperclus * freeclus
Label4.Caption = "Free space:" & freespace & "bytes"
Dir2.Path = Drive2.Drive
'Do a Test of Drive2`s Text
Debug.Print Drive2.Drive
'Covert Free Space From Bytes to KB ,MB ,Gig ect.
If freespace >= 1000000000 Then
freespace = Val(freespace) / 1000000000
Label4.Caption = "Free space:" & Int(freespace) & "Gig" & " available on " & Drive2.Drive
ElseIf freespace >= 1000000 Then
freespace = Val(freespace) / 1000000
Label4.Caption = "Free space:" & Int(freespace) & "Mb" & " available on " & Drive2.Drive
ElseIf freespace >= 1000 Then
freespace = Val(freespace) / 1000
Label4.Caption = "Free space:" & Int(freespace) & "Kb" & " available on " & Drive2.Drive
Else
Label4.Caption = "Free space:" & Int(freespace) & "Bytes" & " available on " & Drive2.Drive
End If
Exit Sub
DriveError:
MsgBox "Device Not Ready!", vbExclamation, "Error"
Drive2.Drive = Dir2.Path
Exit Sub
Dir2.Refresh
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub File1_Click()
'Make short filename and give value to acename
'===============================================
Dim x As String
Dim buffer As String * 255
x = GetShortPathName(Dir1.Path & "\" & File1.FileName, buffer, 255)
Debug.Print Left(buffer, x) ' Could be C:\MYDOCU~1\RICHTE~1.rtf
acename = Left(buffer, x)
End Sub
Private Sub Form_Load()
Form1.Caption = ""
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
b = ""
Else
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
b = "*.*"
Else
End If
End Sub
Private Sub Timer1_Timer()
If Form1.Caption = "" Then
Form1.Caption = "E"
ElseIf Form1.Caption = "E" Then
Form1.Caption = "Ez"
ElseIf Form1.Caption = "Ez" Then
Form1.Caption = "Ez U"
ElseIf Form1.Caption = "Ez U" Then
Form1.Caption = "Ez Un"
ElseIf Form1.Caption = "Ez Un" Then
Form1.Caption = "Ez Una"
ElseIf Form1.Caption = "Ez Una" Then
Form1.Caption = "Ez Unac"
ElseIf Form1.Caption = "Ez Unac" Then
Form1.Caption = "Ez Unace"
ElseIf Form1.Caption = "Ez Unace" Then
Form1.Caption = ""
End If
End Sub