Finds the command-line arguments within a given path
#include <WinAPIShPath.au3>
_WinAPI_PathGetArgs ( $sFilePath )
$sFilePath | The path to be searched. |
Success: | The string that contains the arguments portion of the path if successful. |
Failure: | Empty string. |
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.
Search PathGetArgs in MSDN Library.
#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)