Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: otrebo en 19 Marzo 2012, 05:50 am



Título: Error robocopy
Publicado por: otrebo en 19 Marzo 2012, 05:50 am
Hola amigos, encontré estos comandos y lo que busco es hacer una copia de seguridad

@echo off

set tiempo=%time:~0,5%
set tiempo=%tiempo::=-%
set fecha=%date:~0%
set fecha=%fecha:/=-%
set file=%fecha% %tiempo%
echo %file%

set ruta="C:\COPIA\%file%"
mkdir %ruta%

robocopy  %1 %ruta%  /E
PAUSE

Trabajo con Win XP y el error que me arroja es:

"robococy" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
presione una tecla para continuar ...

Que puedo harcer para utilizar este programa que me permitiria enviar todo a mi carpeta C:\COPIA\

El xcopy me puede ser util, de ser así, cual sería la forma de utilizarlo aquí. O como, donde conseguir el robocopy.

Un saludo


Título: Re: Error robocopy
Publicado por: HdM en 19 Marzo 2012, 11:37 am
Buenas.

Robocopy viene en windows posteriores a vista. No obstante te la puedes descargar aquí:

http://www.mediafire.com/?d0ukkqo316ogd24 (http://www.mediafire.com/?d0ukkqo316ogd24)

Descomprimes y copias en "C:\windows\system32\"

Saludos.


Título: Re: Error robocopy
Publicado por: edgartt en 20 Marzo 2012, 03:57 am
prueba robocopy segun lo siguiente
Usage : ROBOCOPY source destination [file [file]...] [options]

             source : Source Directory (drive:\path or \\server\share\path).
        destination : Destination Dir  (drive:\path or \\server\share\path).
               file : File(s) to copy  (names/wildcards: default is "*.*").

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.

               /SEC : copy SECurity info (both source and dest must be NTFS).
            /SECFIX : FIX SECurity info on existing files and dirs.
            /TIMFIX : FIX TIMestamps on existing destination files.

               /MOV : MOVe files (delete from source after copying).
              /MOVE : MOVE files AND dirs (delete from source after copying).

             /PURGE : delete dest files/dirs that no longer exist in source.
               /MIR : MIRror a directory tree (equivalent to /E plus /PURGE).

   /A+:[R][A][H] : add the given Attributes to copied files.
   /A-:[R][A][H] : remove the given Attributes from copied files.

            /CREATE : CREATE directory tree structure + zero-length files only.
               /FAT : create destination files using 8.3 FAT file names only.

File Selection:  /A : copy only files with the Archive attribute set
                 /M : like /A, but remove Archive attribute from source files.
   /IA:[R][A][H] : Include only files with some of the given Attributes set.
   /XA:[R][A][H] : eXclude files with any of the given Attributes set.

 /XF file [file]... : eXclude Files matching given names/paths/wildcards.
 /XD dirs [dirs]... : eXclude Directories matching given names/paths.

    /XC | /XN | /XO : eXclude Changed | Newer | Older files.
          /XX | /XL : eXclude eXtra | Lonely files and dirs.
                /IS : Include Same files.

             /MAX:n : MAXimum file size - exclude files bigger than n bytes.
             /MIN:n : MINimum file size - exclude files smaller than n bytes.

          /MAXAGE:n : MAXimum file AGE - exclude files older than n days/date.
          /MINAGE:n : MINimum file AGE - exclude files newer than n days/date.
                      (If n < 1900 then n = n days, else n = YYYYMMDD date).

Retry Options: /R:n : number of Retries on failed copies: default is 1 million.
               /W:n : Wait time between retries: default is 30 seconds.

               /REG : Save /R:n and /W:n in the Registry as default settings.

               /TBD : wait for sharenames To Be Defined (retry error 67).

Logging Options: /L : List only - don't copy, timestamp or delete any files.
                 /X : report all eXtra files, not just those selected.
                 /V : produce Verbose output, showing skipped files.


Título: Re: Error robocopy
Publicado por: Eleкtro en 20 Marzo 2012, 04:18 am
Como dices que no tienes necesidad de usar robocopy no te compliques, Te modifico el code para usar el XCopy.

Código
  1. @Echo OFF
  2. set tiempo=%time:~0,5%
  3. set tiempo=%tiempo::=-%
  4. set fecha=%date:~0%
  5. set fecha=%fecha:/=-%
  6. set file=%fecha% %tiempo%
  7. echo %file%
  8.  
  9. set "ruta=C:\COPIA\%file%\"
  10. mkdir "%ruta%"
  11.  
  12. XCopy /E /Y %1 "%ruta%"

PD: Recuerda que "XCopy" solo sirve para copiar carpetas (Y su contenido). Si lo que quieres es copiar un archivo usa el comando "Copy".
Código
  1. Copy /Y %1 "%ruta%"

Saludosss