The CopyFile method copies an existing file to a new file.
Kernel.CopyFile (ExistingFileName as String, NewFileName as String, [FailIfExists as Boolean = True])
| Where | Type | Optional | Default | Description |
|---|---|---|---|---|
| ExistingFileName | String | The name of an existing file to copy. | ||
| NewFileName | String | The name of the new file. | ||
| FailIfExists | Boolean | yes | True | If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds. |
This function calls CopyFile Win32 API function (kernel32)
Security attributes for the existing file are not copied to the new file.
Kernel - copy file |
Dim Kernel
Set Kernel = CreateObject("ScriptUtils.Kernel")
Kernel.CopyFile "H:\zivot.wav\AF - Buh je verny a co ty.wav", "j:\pokusss.wav" |
CloseHandle, CopyFile, CreateProcess, DeleteFile, GetFileSize, MoveFile, Sleep, SwitchToThread, WaitForSingleObject
CommandLine, ComputerName, CurrentDirectory, CurrentProcess, CurrentThread, EnvironmentStrings, EnvironmentVariables, hrCounter, hrFrequency, hrTimeCounter, TempPath, TickCount
COM API for calling some of Kernel32 functions.
© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: info@pstruh.cz