Kopieren von Dateien
-
Hallo,
ich wuerde geren mein *.EXE datei in ein anderes verzeichniss kopieren.Weiß jemand wie ich Dateien kopier?
-
Hi, probiers mal mit "CopyFileTo" bzw. guck dir das mal in der Hilfe an. Hier ein kleiner Auszug:
"function CopyFileTo(const Source: string; const Destination: string): Boolean;"Ansonsten einfach
system("copy "C:\\Programme\\DeinProgramm\\programm.exe" "C:\\Programme\\Neues Ziel")
Allerdings musst du vor dem 2. " und dem 3. " ein escape-zeichen setzen. Ich weiß nur grad nicht welches.
-
system("copy \"C:\\Programme\\DeinProgramm\\programm.exe\" \"C:\\Programme\\Neues Ziel\"")So müsste das jetzt korrekt sein.
-
WIN 32 API
CopyFile oder CopyFileEx
BOOL CopyFile( LPCTSTR lpExistingFileName, // pointer to name of an existing file LPCTSTR lpNewFileName, // pointer to filename to copy to BOOL bFailIfExists // flag for operation if file exists );BOOL CopyFileEx( LPCWSTR lpExistingFileName, // pointer to name of an existing file LPCWSTR lpNewFileName, // pointer to filename to copy to LPPROGRESS_ROUTINE lpProgressRoutine, // pointer to the callback function LPVOID lpData, // to be passed to the callback function LPBOOL pbCancel, // flag that can be used to cancel the operation DWORD dwCopyFlags // flags that specify how the file is copied );
-
Danke fuer eure schnellen antworten!!!
es funktionirt...
-
Welche Variante hast du benutzt? ^^
-
deine.. aber da kann ich keine variablen nehmen..
un es oeffnet sich nen WinConsol fenster.. zwar nur ganz kurz aber trozdem..ich prob gerad des andere...
-
Doch klar kannst du Variablen nehmen. Die dürfen dann aber nicht in Anführungszeichen stehen
AnsiString path = "C:\Programme\programm.exe"; system("copy " + path + "C:\xyz");ich glaub so müsste das gehen