ERFORDERLICHE
OBJEKTE
1 Commandbutton (Command1)
FORM-CODE
Private Declare Function SHFormatDrive Lib "shell32" _
(ByVal hwnd As Long, ByVal Drive As Long, _
ByVal fmtID As Long, ByVal options As Long) As Long
Private Declare Function GetDriveType Lib "kernel32" _
Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Sub Command1_Click()
Dim DriveLetter$, DriveNumber&, DriveType&
Dim RetVal&, RetFromMsg&
'Laufwerk A=0; Laufwerk B=1
DriveNumber = 0
DriveType = GetDriveType(DriveLetter)
If DriveType = 2 Then
RetVal = Shell("rundll32.exe diskcopy.dll,DiskCopyRunDll " _
& DriveNumber & "," & DriveNumber, 1)
Else
RetFromMsg = MsgBox("Nur Diskettenlaufwerke" & vbCrLf & _
"können kopiert werden !", 64, "Diskette kopieren")
End If
End Sub
|