

Mais ce qui est embêtant c'est de créer tous ses répertoires à chaque fois qu'on copie des nouvelles photos depuis l'appareil. Surtout que les photos ont déjà cette information dedans.
Je me suis crée un petit 'script' qui transfère les photos de l'appareil photo sur le PC, en créant les répertoires nécessaires selon la date de prise de chaque photo.
Pour l'utiliser, il faut
- se créer un fichier texte (Bloc Notes pas Word)
- copier-coller le texte ci-dessous dedans
- modifier les deux premières lignes pour refléter les chemins d'accès que vous voulez
- renommer le fichier en quelque chose .vbs (au lieu de .txt).

The painful thing is creating all those folders to copy the photos into. Especially as the information is already there in the photos.
I wrote myself a little script which copies the photos from the camera, creating the necessary folders as it goes.
To use it you will need to:
- Create a text file (Notepad, not Word)
- Copy and paste the following text into it
- Change the first two lines to reflect your setup
- Rename the file from .txt to .vbs
targetFolder = "C:\Documents and Settings\ben\My Documents\My Pictures\Current"
sourceFolder = "G:\DCIM"
set fso = createObject ("Scripting.FileSystemObject")
set fld = fso.GetFolder(sourceFolder)
for each fldr in fld.SubFolders
for each fil in fldr.files
newFolder = CheckFolder(fil.DateCreated)
if fso.FileExists(newFolder & "\" & fil.Name) then
Call fil.Copy (newFolder & "\cpy_" & fil.Name)
else
Call fil.Copy (newFolder & "\" & fil.Name)
end if
'Delete original
Call fil.Delete(true)
next
next
Call Msgbox ("Done copying folders, you can now disconnect " & sourceFolder)
Function CreateFolder(trg)
if not fso.FolderExists(trg) then
Call fso.CreateFolder(trg)
end if
CreateFolder = trg
End Function
Function CheckFolder(dt)
y=Year(dt)
m=Right("0" & Month(dt), 2)
d=Right("0" & Day(dt), 2)
CheckFolder = CreateFolder(targetFolder & "\" & y)
CheckFolder = CreateFolder(CheckFolder & "\" & y & "-" & m)
CheckFolder = CreateFolder(CheckFolder & "\" & y & "-" & m & "-" & d)
End Function
No comments yet :
Post a Comment