﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3726	_WinAPI_PathGetArgs / _WinAPI_PathRemoveArgs -- using like the help example can lead to errors	BugFix		"The help example for the _WinAPI_PathGetArgs and _WinAPI_PathRemoveArgs functions uses the _WinAPI_AssocQueryString function as the source for the command line.
However, this can lead to errors if the path of the executable is not enclosed in string delimiters. The Remarks specifically mention not to use such features (""This function should not be used on generic command path templates (from users or the registry)"").
But in the example the function _WinAPI_AssocQueryString is used, which accesses the registry.

The following can happen:
{{{
#include <WinAPIShPath.au3>
#include <APIRegConstants.au3>
#include <WinAPIReg.au3>

Local $sCmd = _WinAPI_AssocQueryString('.profile', $ASSOCSTR_COMMAND)
ConsoleWrite('$sCmd: ' & $sCmd & @CRLF)    ; TRUE   --> C:\Program Files\Intel\bin\iWrap.exe /CMD:7 %1

Local $sPath = _WinAPI_PathRemoveArgs($sCmd)
ConsoleWrite(""$sPath: "" & $sPath & @LF)    ; FALSE  --> C:\Program

Local $sArgs = _WinAPI_PathGetArgs($sCmd)
ConsoleWrite(""$sArgs: "" & $sArgs & @LF)    ; FALSE  --> Files\Intel\bin\iWrap.exe /CMD:7 %1
}}}

I would recommend using a defined path for the help example, instead of _WinAPI_AssocQueryString.
{{{
Local $sCmd = '""C:\Program Files\Intel\bin\iWrap.exe"" /CMD:7 %1'
}}}"	Bug	closed		Standard UDFs	3.3.14.0	None	Works For Me	_WinAPI_PathGetArgs, _WinAPI_PathRemoveArgs	
