Jump to content

Recommended Posts

Posted

Hi to all i'm trying to made this function: PathRemoveArgs in autoit, but this not work (it surely my fault). Here is my code:

#include <Array.au3>
$Path = '"C:\program files\TEST.exe" -nogui'
$d_call = DllCall("shlwapi.dll", "int", "PathRemoveArgs", "wstr", $Path)
If Not @error Then
_ArrayDisplay($d_call)
EndIf

That will always return the same path, but i want to know only the real path whitout it's arguments. How i can fix that?

Hi!

Posted (edited)

Thanks Yashied thanks a lot, but i've seen this: "This function should not be used on generic command path templates (from users or the registry)".

I'm currently reading from the values from startup key: (HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionRun"), then i read the file path and check if the .exe exists.

Do you suggest me to use this function or what?

Hi and thank you so much.

Edited by StungStang
Posted

Yes this surely work fine but the dubt is about that:

"This function should not be used on generic command path templates (from users or the registry)"

As i said before I'm currently reading the values from startup key: (HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionRun"), then i read the file path and check if the .exe exists.

If this function should not should not be used on the registry, there is a good alternative?

Hi!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...