Function Reference


Returns the name of a nonexistent file copies.

#Include <FileOperations.au3>
_FO_GetCopyName ( $sPath [, $iMode=0 [, $sText='Copy']] )


$sPath The full path to the directory or file
$iMode [optional] How to add an index
    0 - Standard, similar to creating a copy of a file in Win7 (default)
    1 - Append index to copies _1, _2, and so on.
$sText [optional] The text "Copy" can change depending on localization

Return Value

Success:Returns the path of the file copies


The function does not return an error, because returns a row back (if the file does not exist), or the correct name.


#include <FileOperations.au3>

ShellExecute(@HomeDrive) ; open the disc to see the creation of new files
$iMode = 0
For $i = 1 To 6
    If $i > 3 Then $iMode = 1
    ; creates on disk 6 copies of files. Three copies for two modes
    $sPath = _FO_GetCopyName(@HomeDrive & '\I am the new file.txt', $iMode)
    FileWrite($sPath, '1') ; file creation