Function Reference


_WinAPI_PathGetArgs

Finds the command-line arguments within a given path

#include <WinAPIShPath.au3>
_WinAPI_PathGetArgs ( $sFilePath )

Parameters

$sFilePath The path to be searched.

Return Value

Success: The string that contains the arguments portion of the path if successful.
Failure: Empty string.

Remarks

This function should not be used on generic command path templates (from users or the registry), but rather
should be used only on templates that the application knows to be well formed.

See Also

Search PathGetArgs in MSDN Library.

Example

#include <APIRegConstants.au3>
#include <WinAPIReg.au3>
#include <WinAPIShPath.au3>

Local $sPath = _WinAPI_AssocQueryString('.txt', $ASSOCSTR_COMMAND)
ConsoleWrite('Command: ' & $sPath & @CRLF)
ConsoleWrite('Path: ' & _WinAPI_PathRemoveArgs($sPath) & @CRLF)
ConsoleWrite('Arguments: ' & _WinAPI_PathGetArgs($sPath) & @CRLF & @CRLF)

$sPath = '1 2 3'
ConsoleWrite('Command: ' & $sPath & @CRLF)
ConsoleWrite('Path: ' & _WinAPI_PathRemoveArgs($sPath) & @CRLF)
ConsoleWrite('Arguments: ' & _WinAPI_PathGetArgs($sPath) & @CRLF & @CRLF)

$sPath = StringFormat('very long string %260s', "1")
ConsoleWrite('Command: ' & $sPath & @CRLF)
ConsoleWrite('Path: ' & _WinAPI_PathRemoveArgs($sPath) & @CRLF)
ConsoleWrite('Arguments: "' & _WinAPI_PathGetArgs($sPath) & '"' & @CRLF & @CRLF)