lunes, 25 de abril de 2016

Toda la documentación del comando xcopy. Muy útil para generar scripts de instalaciones... y automatizaciones de procesos

Xcopy

Copies files and directories, including subdirectories.

Syntax

xcopy Source [Destination] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d[:mm-dd-yyyy]] [/u] [/i] [/s [/e]] [/t] [/k] [/r] [/h] [{/a|/m}] [/n] [/o] [/x] [/exclude:file1[+[file2]][+[file3]] [{/y|/-y}] [/z]

Parameters

Source Required. Specifies the location and names of the files you want to copy. This parameter must include either a drive or a path.
Destination Specifies the destination of the files you want to copy. This parameter can include a drive letter and colon, a directory name, a file name, or a combination of these.
/w Displays the following message and waits for your response before starting to copy files:
Press any key to begin copying file(s)
/p Prompts you to confirm whether you want to create each destination file.
/c Ignores errors.
/v Verifies each file as it is written to the destination file to make sure that the destination files are identical to the source files.
/q Suppresses the display of xcopy messages.
/f Displays source and destination file names while copying.
/l Displays a list of files that are to be copied.
/g Creates decrypted destination files.
/d[:mm-dd-yyyyCopies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Source files that are newer than existing Destinationfiles. This command-line option allows you to update files that have changed.
/u Copies files from Source that exist on Destination only.
/i If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory.
/s Copies directories and subdirectories, unless they are empty. If you omit /sxcopy works within a single directory.
/e Copies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options.
/t Copies the subdirectory structure (that is, the tree) only, not files. To copy empty directories, you must include the /e command-line option.
/k Copies files and retains the read-only attribute on destination files if present on the source files. By default, xcopy removes the read-only attribute.
/r Copies read-only files.
/h Copies files with hidden and system file attributes. By default, xcopy does not copy hidden or system files.
/a Copies only source files that have their archive file attributes set. /a does not modify the archive file attribute of the source file. For information about how to set the archive file attribute by usingattrib, see Related Topics.
/m Copies source files that have their archive file attributes set. Unlike /a/m turns off archive file attributes in the files that are specified in the source. For information about how to set the archive file attribute by using attrib, see Related Topics.
/n Creates copies by using the NTFS short file or directory names. /n is required when you copy files or directories from an NTFS volume to a FAT volume or when the FAT file system naming convention (that is, 8.3 characters) is required on the destination file system. The destination file system can be FAT or NTFS.
/o Copies file ownership and discretionary access control list (DACL) information.
/x Copies file audit settings and system access control list (SACL) information (implies /o).
/exclude:filename1[+[filename2]][+[filename3]] Specifies a list of files containing strings.
/y Suppresses prompting to confirm that you want to overwrite an existing destination file.
/-y Prompts to confirm that you want to overwrite an existing destination file.
/z Copies over a network in restartable mode.
/? Displays help at the command prompt.

Remarks

Using /v 
Windows XP does not use this command. It is accepted only for compatibility with MS-DOS files.
Using /exclude 
List each string in a separate line in each file. If any of the listed strings match any part of the absolute path of the file to be copied, that file is then excluded from the copying process. For example, if you specify the string "\Obj\", you exclude all files underneath the Obj directory. If you specify the string ".obj", you exclude all files with the .obj extension.
Using /z 
If you lose your connection during the copy phase (for example, if the server going offline severs the connection), it resumes after you reestablish the connection. /z also displays the percentage of the copy operation completed for each file.
Using /y in the COPYCMD environment variable
You can use /y in the COPYCMD environment variable. You can override this command by using /-y on the command line. By default, you are prompted to overwrite, unless you run copy from within a batch script.
Copying encrypted files
Copying encrypted files to a volume that does not support EFS results in an error. Decrypt the files first or copy the files to a volume that does support EFS.
Appending files
To append files, specify a single file for destination, but multiple files for source (that is, by using wildcards or file1+file2+file3 format).
Default value for Destination 
If you omit Destination, the xcopy command copies the files to the current directory.
Specifying whether Destination is a file or directory
If Destination does not contain an existing directory and does not end with a backslash (\), the following message appears:
Does destination specify a file name 
or directory name on the target 
(F = file, D = directory)? 
Press F if you want the file or files to be copied to a file. Press D if you want the file or files to be copied to a directory.
You can suppress this message by using the /i command-line option, which causes xcopy to assume that the destination is a directory if the source is more than one file or a directory.
Using the xcopy command to set archive attribute for Destination files
The xcopy command creates files with the archive attribute set, whether or not this attribute was set in the source file. For more information about file attributes and attrib, see Related Topics.
Comparing xcopy and diskcopy 
If you have a disk that contains files in subdirectories and you want to copy it to a disk that has a different format, use the xcopy command instead of diskcopy. Because the diskcopy command copies disks track by track, your source and destination disks must have the same format. The xcopy command does not have this requirement. Use xcopy unless you need a complete disk image copy.
Exit codes for xcopy 
To process exit codes returned by xcopy, use the errorlevel parameter on the if command line in a batch program. For an example of a batch program that processes exit codes using if, see Related Topics. The following table lists each exit code and a description.
Exit codeDescription
0
Files were copied without error.
1
No files were found to copy.
2
The user pressed CTRL+C to terminate xcopy.
4
Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line.
5
Disk write error occurred.

Examples

To copy all the files and subdirectories (including any empty subdirectories) from drive A to drive B, type:
xcopy a: b: /s /e
To include any system or hidden files in the previous example, add the/h command-line option as follows:
xcopy a: b: /s /e /h
To update files in the \Reports directory with the files in the \Rawdata directory that have changed since December 29, 1993, type:
xcopy \rawdata \reports /d:12-29-1993 
To update all the files that exist in \Reports in the previous example, regardless of date, type:
xcopy \rawdata \reports /u
To obtain a list of the files to be copied by the previous command (that is, without actually copying the files), type:
xcopy \rawdata \reports /d:12-29-1993 /l > xcopy.out
The file Xcopy.out lists every file that is to be copied.
To copy the \Customer directory and all subdirectories to the directory \\Public\Address on network drive H:, retain the read-only attribute, and be prompted when a new file is created on H:, type:
xcopy \customer h:\public\address /s /e /k /p
To issue the previous command, ensure that xcopy creates the \Address directory if it does not exist, and suppress the message that appears when you create a new directory, add the /i command-line option as follows:
xcopy \customer h:\public\address /s /e /k /p /i
You can create a batch program to perform xcopy operations and use the batch if command to process the exit code if an error occurs. For example, the following batch program uses replaceable parameters for the xcopy source and destination parameters:
@echo off 
rem COPYIT.BAT transfers all files in all subdirectories of
rem the source drive or directory (%1) to the destination rem drive or directory (%2) 

xcopy %1 %2 /s /e 

if errorlevel 4 goto lowmemory 
if errorlevel 2 goto abort 
if errorlevel 0 goto exit 

:lowmemory 
echo Insufficient memory to copy files or 
echo invalid drive or command-line syntax. 
goto exit 

:abort 
echo You pressed CTRL+C to end the copy operation. 
goto exit 

:exit 
To use this batch program to copy all files in the C:\Prgmcode directory and its subdirectories to drive B, type:
copyit c:\prgmcode b: 

The command interpreter substitutes C:\Prgmcode for %1 and B: for %2, then uses xcopy with the /e and /s command-line options. If xcopy encounters an error, the batch program reads the exit code and goes to the label indicated in the appropriate IF ERRORLEVEL statement, then displays the appropriate message and exits from the batch program.
Fuente: https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

identificar y corregir errores Redsys

Código de respuesta de SERMEPA / REDSYS.  Si al acceder a la pagina de redsys nos lanza un error podemos identificar y corregir el eror, debemos "ver el codigo fuente" de la pagina de error y buscar el codigo del error para identificar el problema, Como vemos en el ejemplo de abajo aparece en comentario html el codigo de error y mediante las tablas de abajo podemos identificarlo.
Ejemplo


<td colspan="2" class="resultado"><font class="denegacion">

<!--SIS0075:-->Error en datos enviados. Contacte con su comercio.</font></td>
 Error en datos enviados. Contacte con su comercio.

ERRORS = {
:SIS0007 => “Error al desmontar el XML de entrada”,
:SIS0008 => “Error falta Ds_Merchant_MerchantCode”,
:SIS0009 => “Error de formato en Ds_Merchant_MerchantCode”,
:SIS0010 => “Error falta Ds_Merchant_Terminal”,
:SIS0011 => “Error de formato en Ds_Merchant_Terminal”,
:SIS0014 => “Error de formato en Ds_Merchant_Order”,
:SIS0015 => “Error falta Ds_Merchant_Currency”,
:SIS0016 => “Error de formato en Ds_Merchant_Currency”,
:SIS0018 => “Error falta Ds_Merchant_Amount”,
:SIS0019 => “Error de formato en Ds_Merchant_Amount”,
:SIS0020 => “Error falta Ds_Merchant_MerchantSignature”,
:SIS0021 => “Error la Ds_Merchant_MerchantSignature viene vacía”,
:SIS0022 => “Error de formato en Ds_Merchant_TransactionType”,
:SIS0023 => “Error Ds_Merchant_TransactionType desconocido”,
:SIS0026 => “Error No existe el comercio / terminal enviado”,
:SIS0027 => “Error Moneda enviada por el comercio es diferente a la que tiene asignada para ese terminal”,
:SIS0028 => “Error Comercio / terminal está dado de baja”,
:SIS0030 => “Error en un pago con tarjeta ha llegado un tipo de operación no valido”,
:SIS0031 => “Método de pago no definido”,
:SIS0034 => “Error de acceso a la Base de Datos “,
:SIS0038 => “Error en java”,
:SIS0040 => “Error el comercio / terminal no tiene ningún método de pago asignado”,
:SIS0041 => “Error en el cálculo de la firma de datos del comercio”,
:SIS0042 => “La firma enviada no es correcta”,
:SIS0046 => “El BIN de la tarjeta no está dado de alta”,
:SIS0051 => “Error número de pedido repetido”,
:SIS0054 => “Error no existe operación sobre la que realizar la devolución”,
:SIS0055 => “Error no existe más de un pago con el mismo número de pedido”,
:SIS0056 => “La operación sobre la que se desea devolver no está autorizada”,
:SIS0057 => “El importe a devolver supera el permitido”,
:SIS0058 => “Inconsistencia de datos, en la validación de una confirmación”,
:SIS0059 => “Error no existe operación sobre la que realizar la devolución”,
:SIS0060 => “Ya existe una confirmación asociada a la preautorización”,
:SIS0061 => “La preautorización sobre la que se desea confirmar no está autorizada”,
:SIS0062 => “El importe a confirmar supera el permitido”,
:SIS0063 => “Error. Número de tarjeta no disponible”,
:SIS0064 => “Error. El número de tarjeta no puede tener más de 19 posiciones”,
:SIS0065 => “Error. El número de tarjeta no es numérico”,
:SIS0066 => “Error. Mes de caducidad no disponible”,
:SIS0067 => “Error. El mes de la caducidad no es numérico”,
:SIS0068 => “Error. El mes de la caducidad no es válido”,
:SIS0069 => “Error. Año de caducidad no disponible”,
:SIS0070 => “Error. El Año de la caducidad no es numérico”,
:SIS0071 => “Tarjeta caducada”,
:SIS0072 => “Operación no anulable”,
:SIS0074 => “Error falta Ds_Merchant_Order”,
:SIS0075 => “Error el Ds_Merchant_Order tiene menos de 4 posiciones o más de 12”,
:SIS0076 => “Error el Ds_Merchant_Order no tiene las cuatro primeras posiciones numéricas”,
:SIS0078 => “Método de pago no disponible”,
:SIS0079 => “Error al realizar el pago con tarjeta”,
:SIS0081 => “La sesión es nueva, se han perdido los datos almacenados”,
:SIS0089 => “El valor de Ds_Merchant_ExpiryDate no ocupa 4 posiciones”,
:SIS0092 => “El valor de Ds_Merchant_ExpiryDate es nulo”,
:SIS0093 => “Tarjeta no encontrada en la tabla de rangos”,
:SIS0112 => “Error. El tipo de transacción especificado en Ds_Merchant_Transaction_Type no esta permitido”,
:SIS0115 => “Error no existe operación sobre la que realizar el pago de la cuota”,
:SIS0116 => “La operación sobre la que se desea pagar una cuota no es una operación válida”,
:SIS0117 => “La operación sobre la que se desea pagar una cuota no está autorizada”,
:SIS0118 => “Se ha excedido el importe total de las cuotas”,
:SIS0119 => “Valor del campo Ds_Merchant_DateFrecuency no válido”,
:SIS0120 => “Valor del campo Ds_Merchant_CargeExpiryDate no válido”,
:SIS0121 => “Valor del campo Ds_Merchant_SumTotal no válido”,
:SIS0122 => “Valor del campo Ds_merchant_DateFrecuency o Ds_Merchant_SumTotal tiene formato incorrecto”,
:SIS0123 => “Se ha excedido la fecha tope para realizar transacciones”,
:SIS0124 => “No ha transcurrido la frecuencia mínima en un pago recurrente sucesivo”,
:SIS0132 => “La fecha de Confirmación de Autorización no puede superar en más de 7 días a la de Preautorización”,
:SIS0139 => “Error el pago recurrente inicial está duplicado SIS0142 Tiempo excedido para el pago”,
:SIS0216 => “Error Ds_Merchant_CVV2 tiene mas de 3/4 posiciones”,
:SIS0217 => “Error de formato en Ds_Merchant_CVV2”,
:SIS0221 => “Error el CVV2 es obligatorio”,
:SIS0222 => “Ya existe una anulación asociada a la preautorización”,
:SIS0223 => “La preautorización que se desea anular no está autorizada”,
:SIS0225 => “Error no existe operación sobre la que realizar la anulación”,
:SIS0226 => “Inconsistencia de datos, en la validación de una anulación”,
:SIS0227 => “Valor del campo Ds_Merchan_TransactionDate no válido”,
:SIS0252 => “El comercio no permite el envío de tarjeta”,
:SIS0253 => “La tarjeta no cumple el check-digit”,
:SIS0261 => “Operación detenida por superar el control de restricciones en la entrada al SIS SIS0274 Tipo de operación desconocida o no permitida por esta entrada al SIS”
}

RESPONSE_CODES = {
:’0101′ => “Tarjeta Caducada”,
:’0102′ => “Tarjeta en excepción transitoria o bajo sospecha de fraude”,
:’0116′ => “Disponible Insuficiente”,
:’0118′ => “Tarjeta no Registrada”,
:’0180′ => “Tarjeta ajena al servicio”,
:’0184′ => “Error en la autenticación del titular”,
:’0190′ => “Denegación sin especificar motivo”,
:’0191′ => “Fecha de caducidad errónea”,
:’0202′ => “Tarjeta en excepción transitoria o bajo sospecha de fraude con retirada de tarjeta”,
:’0912′ => “Emisor no Disponible”,
:’9912′ => “Emisor no Disponible”,
:’0904′ => “Comercio no registrado en FUC”,
:’9064′ => “Número de posiciones de la tarjeta incorrecto”,
:’9078′ => “No existe método de pago válido para esa tarjeta”,
:’9093′ => “Tarjeta no existente”,
:’9218′ => “El comercio no permite op. seguras por entrada /operaciones”,
:’9253′ => “Tarjeta no cumple el check-digit”,
:’9256′ => “El comercio no puede realizar preautorizaciones”,
:’9257′ => “Esta tarjeta no permite operativa de preautorizaciones”,
:’9261′ => “Operación detenida por superar el control de restricciones en la entrada al SIS”,
:’9913′ => “Error en la confirmación que el comercio envía al TPV Virtual (solo aplicable en la opción de sincronización SOAP)”,
:’9914′ => “Confirmación “KO” del comercio (solo aplicable en la opción de sincronización SOAP)”,
:’9928′ => “Anulación de autorización en diferido realizada por el SIS (proceso batch)”,
:’9929′ => “Anulación de autorización en diferido realizada por el comercio”,
}


 Fuente de tablas de errores: http://dwalins.com/2014/codigo-de-respuesta-de-sermepa-redsys/

martes, 19 de abril de 2016

jquery $ is not defined in angularjs

Este mensaje me ha dado muchos dolores de cabeza en angularJS y tampoco he encontrado solución por ningún foro o ayuda. Expongo mi experiencia por si ha alguien le es útil. EL objetivo era intentar usar el plugin de Jquery owl-carousel en un proyecto con Angular JS donde obtendriamos la información a mostrar en el owl de forma asíncrona mediante promesas en servicios de angularJS ("peticiones ajax"). Al usar el proyecto en un servidor apache funciona correctamente. Al visualizar el proyecto mediante el motor de ionic con el comando "ionic serve" lanza el error "$ is not defined in angularjs" por la consola y no es capaz de generar correctamente el slider. El motivo es que el script de ionic.bundle "bloquea" los scripts durante el desarrollo como indica en el comentario por defecto que anuncia: Si intentamos visualizar el contenido del jquery.js en la consola de desarrollador de chrome, pestaña de sources. Vemos que no muestra contenido. Ni es capaz de ejecutar setencias de jquery en la consola. Para solucionarlo basta modificar las importaciones locales por recursos no locales: Ejemplo:

Jesús Moreno - Ingeniero Ténico Informático - consultor Informático

Hola, soy Jesús Moreno Ingeniero Técnico Informático en sistemas por la US y propietario de éste blog. Mi trabajo en los ultimos años se ...