Ver Mensaje Individual
  #6  
Antiguo 11-01-2011
peli peli is offline
Registrado
NULL
 
Registrado: ene 2011
Posts: 2
Reputación: 0
peli Va por buen camino
hola el ejemplo me ha servido pero necesito completar algo: necesito saber como puedo copiar el contenido de una carpeta o directorio que tengo en el cd, o sea, o especificamente todo el contenido, sino una carpeta.

por ejemplo he usado este codigo para copiar desde la unidad de cd al disco c:

GetLogicalDriveStrings(SizeOf(Buffer),Buffer);
TmpPC := Buffer;
while TmpPC[0] <> #0 do begin
if GetDriveType(TmpPC) = Drive_CDROM then
WinExec ('xcopy TmpPC carpeta c:\carpeta /s',sw_Hide);
TargetName := 'c:\GESTIONMEDICA\GestionMedica.exe';
TmpPC := StrEnd(TmpPC)+1;
end;

IObject := CreateComObject(CLSID_ShellLink) ;
ISLink := IObject as IShellLink;
IPFile := IObject as IPersistFile;

with ISLink do
begin
SetPath(pChar(TargetName)) ;
SetWorkingDirectory(pChar(ExtractFilePath(TargetName))) ;
end;

SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL) ;
SHGetPathFromIDList(PIDL, InFolder) ;
LinkName := InFolder + '\Gestion Medica.lnk';
IPFile.Save(PWChar(LinkName), false) ;

En la linea:

WinExec ('xcopy TmpPC carpeta c:\carpeta /s',sw_Hide);

no se como como especificar el nombre de la campeta que quiero que se compie desde el cd....

por favor ayuda..... y gracias.
Responder Con Cita