Windows 7 - 파일 이름으로 파일 목록을 찾아 폴더에 복사하는 방법

Windows 7 - 파일 이름으로 파일 목록을 찾아 폴더에 복사하는 방법

200개의 파일 이름 목록이 있습니다. 다른 하위 폴더에 있는 파일을 파일 이름으로 찾아서 하나의 별도 폴더에 복사해야 합니다. 저는 Windows 7을 사용하고 있습니다. 어떻게 해야 합니까?

고마워요, 나탈리아

답변1

내 제안은 Ninite.com으로 이동하여 "Everything"이라는 무료 도구를 다운로드하는 것입니다. 간단한 Windows 검색 도구입니다. 설치 후 파일 색인을 생성하는 데 5분 정도 기다려 주세요.

검색 필드에 검색어를 입력하면 Google에서와 마찬가지로 즉각적인 결과를 얻을 수 있습니다. 결과를 확인한 후, Windows 탐색기처럼 Everything 검색 창에서 직접 파일을 조작할 수 있습니다. '모두 선택'한 다음 복사한 다음 Win Explorer에서 원하는 폴더로 이동하여 붙여 넣을 수 있습니다.

모든 것이 정말 좋은 도구입니다. 전체 파일 이름을 입력할 필요도 없으며 일부만 입력하면 됩니다. 예를 들어 'eag mp3'는 'eagles - song name.mp3'와 같이 파일 이름에 'eag'가 포함된 모든 MP3를 반환합니다.

답변2

여기요. 먼저 테스트 실행을 수행하십시오. 댓글을 주의 깊게 읽어보세요.

fullfilenames.txt 파일은 유지되므로 발견된 각 파일에 대한 기록을 남길 수 있습니다. 이 작업을 두 번 이상 실행해야 하고 파일을 유지하려면 파일을 이동하거나 이름을 바꾸세요.

'movelog.txt' 로그 파일이 생성됩니다. 위와 같이 각 실행 후에 유지하려면 이동하거나 이름을 바꾸십시오.

# Set your search directory and destination directory
$destdir = "[destination for files]"
$searchdir = "[top dir of search path]"

# Create empty file to contain the full path info for each file
echo $null > fullfilenames.txt
# Create array from your list of filenames
$filenames = Get-Content filenames.txt
# For each file in array of filenames get fullpath and assign var $fullname
foreach ($file in $filenames) {
     $fullname = Get-ChildItem $searchdir | Where-Object {$_.PSIsContainer -eq $False -and ($_.Name) -eq $file} | ForEach-Object {$_.FullName}
     # Add full path of file to fullfilenames.txt
     echo $fullname >> fullfilenames.txt
     # Uncomment next two lines for troubleshooting & dry run
     #echo $file
     #Write-Host $fullname
}

# Create array from new list of files with full path info and then move each file to destination.
# For troubleshooting & dry run, comment out following two lines.
$filenames = Get-Content fullfilenames.txt
echo $null > movelog.txt
foreach ( $file in $filenames ) {
    Move-Item $file $destdir
    # Log success/fail of each move
    echo "$(Get-Date -f o) $? $file" >> movelog.txt
}

참고: 이는 Powershell 스크립트입니다. everything.ps1로 저장하고 PowerShell 콘솔에서 실행하세요.

즐기다

답변3

로 구분하여 "Everything"에 있는 파일 목록을 검색할 수 있습니다 |.

예를 들어:file1|file2|file3|file4

"Everything" 다운로드 링크:https://www.voidtools.com/downloads/

관련 정보