Set fso = CreateObject("Scripting.FileSystemObject")
Const TIMEOUT = 1
Dim Info
Set Info = CreateObject ("WScript.Shell")
Dim co_all
Dim co_new
co_all = 0
co_new = 0
sStartFolder = "C:\Downloads\3Bearbeiten\"
sBackupFolder = "F:\Karaoke\Songs\"
Dim ObjFso : Set ObjFso = CreateObject("Scripting.FileSystemObject")
Dim FIL_LOG : FIL_LOG = sStartFolder & Replace(WScript.ScriptName,".vbs",".log")
Function WriteLog(Inhalt)
'------------------ write Logfile ---------------------------------
Dim FileOut
Set FileOut = ObjFso.OpenTextFile(FIL_LOG,8,true)
FileOut.WriteLine (Now &" - " & Inhalt)
FileOut.Close
Set FileOut = Nothing
End Function
Set folder = fso.GetFolder(sStartFolder)
Set NewSongs = folder.subFolders
WriteLog ("START")
For each NewSong In NewSongs
moveZiel = ""
Set re = New RegExp
re.Pattern = "[a-z]"
re.IgnoreCase = True
re.Global = True
If (isNumeric(left(NewSong.Name,1))) then
moveZiel = sBackupFolder + "0-9\"
elseif (left(NewSong.Name,3) = "Die") then
moveZiel = sBackupFolder + "Die\"
elseif (left(NewSong.Name,3) = "The") then
moveZiel = sBackupFolder + "The\"
elseif (re.Test(left(NewSong.Name,1))) then
moveZiel = sBackupFolder + left(NewSong.Name,1) + "\"
else
moveZiel = sBackupFolder + "_\"
end if
'Set SongFolderBackup = moveZiel.NewSongs
if (moveZiel <> "Name") then
SongFolderBackup = moveZiel + NewSong.Name
co_all = co_all +1
If fso.FolderExists(SongFolderBackup) then
Info.Popup "Skip -> " & NewSong.Name & " - Song schon vorhanden", TIMEOUT
'fso.DeleteFolder SongFolderBackup
WriteLog ("Skip " & NewSong.Name & " " & Co_all)
End If
If not fso.FolderExists(SongFolderBackup) then
co_new = co_new + 1
Info.Popup "Copy -> " & NewSong.Name & " -> " & moveZiel, TIMEOUT
fso.CopyFolder NewSong, moveZiel, true
'fso.MoveFolder NewSong, moveZiel
'fso.DeleteFolder NewSong
WriteLog ("Copy " & NewSong.Name & " -> " & moveZiel & " " & Co_all & " - " & Co_new)
end if
end if
Next
WriteLog ("ENDE " & co_new & " von " & co_all & " Songs kopiert")
MsgBox "Ende " & co_new & " von " & co_all & " Songs kopiert" , vbApplicationModal , WScript.ScriptName
VB Script for Copy Songs in Folder
Reglas del Foro
Prohibido pedir canciones en el foro. Si quieres hacerlo que sea aquí
Prohibido pedir canciones en el foro. Si quieres hacerlo que sea aquí
hi! what is the difference with copy & paste using the explorer???
Salu2
Salu2
No respondo a mensajes privados sobre temas que podrían estar en el foro