
Estoy usando Windows 7 y quiero copiar todos los archivos PDF dentro de una carpeta y dentro de todas sus subcarpetas en una nueva ubicación. ¿Cuál es el comando para hacer eso?
Respuesta1
Utilice el xcopy
comando. Puede ir a un símbolo del sistema y escribir xcopy /?
para obtener ayuda para usarlo.
Para tu pregunta particular, el comando completo sería:
xcopy c:\sourcefolder\*.pdf c:\destinationfolder\ /e
Respuesta2
Si desea que todos los archivos PDF vayan a una carpeta:
copy <source path>\*.pdf <destination path> /s
Si desea mantener la estructura de carpetas original:
xcopy <source path>\*.pdf <destination path> /s
Respuesta3
Le recomiendo encarecidamente que utilice RoboCopy, ya que tiene una gran cantidad de opciones (muchas más allá de la lista que le he proporcionado). Sin embargo, como sólo desea copiar archivos PDF, utilice esta sintaxis
Robocopy C:\Usuarios C:\UserBackup *.pdf
Robocopy Syntax
ROBOCOPY source destination [file [file]…] [options]
where source is Source Directory (drive:\path or \\server\share\path), destination is Destination Directory (drive:\path or \\server\share\path) and file is File(s) to copy where names or wildcards can be specified and default is “*.*” (all files).
Robocopy Options and Switches
Copy options :
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/LEV:n :: only copy the top n LEVels of the source directory tree.
/Z :: copy files in restartable mode.
/B :: copy files in Backup mode.
/ZB :: use restartable mode; if access denied use Backup mode.
/EFSRAW :: copy all encrypted files in EFS RAW mode.
/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).
(copyflags : D=Data, A=Attributes, T=Timestamps).
(S=Security=NTFS ACLs, O=Owner info, U=aUditing info).
/DCOPY:T :: COPY Directory Timestamps.
/SEC :: copy files with SECurity (equivalent to /COPY:DATS).
/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).
/NOCOPY :: COPY NO file info (useful with /PURGE).
/SECFIX :: FIX file SECurity on all files, even skipped files.
/TIMFIX :: FIX file TIMes on all files, even skipped files.
/PURGE :: delete dest files/dirs that no longer exist in source.
/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).
/MOV :: MOVe files (delete from source after copying).
/MOVE :: MOVE files AND dirs (delete from source after copying).
Examples:
To use Robocopy is simple, just like how you would use Copy and Xcopy commands. For example, to copy entire folder of C:\Users to C:\UserBackup, simply type:
Robocopy C:\Users C:\UserBackup
Respuesta4
Pruebe esto (en la línea de comando):
for /r "c:\my\source folder" %i in (*.pdf) do copy "%~fi" "c:\my\destination folder\%~nxi"
En el explorador:
..con copiar y pegar puedes arrastrar la carpeta de origen al nuevo destino mientras presionas la ctrltecla.