Adds a file name extension to a path string
#include <WinAPIShPath.au3>
_WinAPI_PathAddExtension ( $sFilePath [, $sExt = ''] )
$sFilePath | The path to which the file name extension will be appended. If there is already a file name extension present, no extension will be added. |
$sExt | [optional] The file name extension. If this parameter is empty string, an ".exe" extension will be added. |
If there is already a file name extension present, no extension will be added.
If the $sFilePath is an empty string, the result will be the file name extension only.
If $sExt is an empty string, an ".exe" extension will be added.
Search PathAddExtension in MSDN Library.
#include <WinAPIShPath.au3>
Local $aPath[2] = ['C:\Documents\Test.txt', 'C:\Documents\Test']
For $i = 0 To 1
ConsoleWrite($aPath[$i] & ' => ' & _WinAPI_PathAddExtension($aPath[$i], '.doc') & @CRLF)
Next