Select files by temp.txt#default:moveasRename PATTERN * TO *@script vbscriptOption ExplicitDim DOpusRTPathDOpusRTPath = "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe"Dim ShellSet Shell = CreateObject("WScript.Shell")' Sélectionner des fichiers et dossiers listés dans un fichier temp.txtDim fsSet fs = CreateObject("Scripting.FileSystemObject")Dim txtFilenametxtFilename = "temp.txt" ' Name of the file that contain files to selectDim flagflag = 0 ' 0 = not initialized, 1 = initialized, 2 = filenames file not found, 3 = clipboard file not found eitherDim cptErrorcptError = 0Dopus.OutputString "Nom du Script : Sélectionner des fichiers ou dossiers à partir d'un temp.txt - Ecrit par Albator V"Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)Dim i, fn, arrLines, LineCount, strData, Line, SrcFolder, DestFolder, strCommand' Open file containing folder list to selectIf flag = 0 Then on error resume next Set fn = fs.OpenTextFile(strFilePath & "\" & txtFilename, 1, false) If err.number > 0 Then flag = 2 Else flag = 1 If flag = 2 Then Dopus.OutputString "Erreur : Pas de fichier '" & txtFilename & "' dans le dossier source." End ifEnd if' Try to find alternate file (clipboard output file)If flag = 2 Then on error resume next Set fn = fs.OpenTextFile(strFilePath & "\Texte du presse-papiers.txt", 1, false) If err.number > 0 Then flag = 3 Else flag = 1 If flag = 1 Then Dopus.OutputString "Info : Un fichier 'Texte du presse-papiers.txt' se trouve dans le dossier source." Dopus.OutputString "Info : Ce fichier sera utilisé pour sélectinner les éléments." txtFilename = "Texte du presse-papiers.txt" Msgbox "Un fichier '" & txtFilename & "' se trouve dans le dossier source." & vbcr & "Il sera utilisé pour sélectionner les éléments à la place du fichier 'temp.txt'.", vbexclamation End if If flag = 3 Then Dopus.OutputString "Erreur : Pas de fichier 'Texte du presse-papiers.txt' dans le dossier source." Dopus.OutputString "Erreur : Aucun dossier n'a été sélectionné." Msgbox "Il y a ni fichier 'temp.txt' ni fichier 'Texte du presse-papiers.txt' dans le dossier source." & vbcr & vbcr & "Aucun dossier n'a été sélectionné.", vbexclamation strNewName = "" Exit Function End ifEnd if' Count lines number in filestrData = fs.OpenTextFile(strFilePath & "\" & txtFilename, 1).ReadAllarrLines = Split(strData, vbCrLf)LineCount = UBound(arrLines) ' + 1Dopus.OutputString "Nombre de ligne total :" & LineCountSet fn = fs.OpenTextFile(strFilePath & "\" & txtFilename, 1, false)' Select filesFor i = 1 to LineCount Line = fn.ReadLine SrcFolder = Line Dopus.OutputString "Ligne du fichier: " & Line strCommand = """" & DOpusRTPath & """ /acmd Select """ & SrcFolder & """" Dopus.OutputString "Commande à executer: " & strCommand Shell.Run strCommand,0,falseNextIf cptError > 0 and cptError = LineCount Then Dopus.OutputString "Info : Tous les dossiers de la liste ont été déplacés dans le dossier de destination."' Set strNewName to an empty string so that Opus does not rename the file.strNewName = ""End Function