You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.0 KiB
Plaintext

' Kopiert Daten von CD und entfernt das Schreibschutzflag
' Christian Breitenstein
' Focke & Co
' 2001
Option Explicit
Dim wshshell
Dim fso
Dim Arguments
Dim FileAcc,TargetFile
Dim Source,Target
Set wshshell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set Arguments = WScript.Arguments
If Arguments.Count <> 2 Then
WScript.Quit 3
End If
Source = Arguments(0)
Target = Arguments(1)
If Right(Target,1) <> "\" Then
Target = Target & "\"
End If
TargetFile = Target & fso.GetBaseName(Source) & "." & fso.GetExtensionName(Source)
If fso.FolderExists(Target) Then
On error Resume Next
If fso.FileExists(TargetFile) Then
Call fso.DeleteFile(TargetFile,True)
End If
Call fso.CopyFile(Source,Target,True)
If err.Number <> 0 Then
MsgBox "Cannot copy " & Source
End If
If Instr(TargetFile,"*") = 0 Then
Set FileAcc = fso.GetFile(TargetFile)
FileAcc.Attributes = FileAcc.Attributes And Not 216 And Not 1
End If
End If
WScript.Quit 1