Sign in to follow this  
Followers 0
Myillon

Shortcuts

4 posts in this topic

Been working at this all day and i dont think its possible/i just cant figure out how to do it

is it possible to pass to autoit the shortcut name that invoked the program?

Ex:

I call the program from two diffrent shortcuts each with diffrent -aruguments.

Im wanting to read -aruguments off the shortcut but i cant figure out which one called it.

Thanks i hope i explained myself clearly :o

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I read over my initial reply, then realized it may be completely off base. I'll leave it anyway in case that IS what you meant, but in rereading your post, I think you just need to look at the function FileGetShortcut. This will return an array that has the shortcut's parameters in element [2]. This also assumes that the shortcut in question is not one of those strange MSI shortcuts - you know, the ones that have the program target greyed out. Don't forget to use the shortcut's full file name including the .lnk extension.

A while back I posted a function that returns the full path to a Process ID - How to get full file name from PID which I created from code generated from SvenP's WMI ScriptOMatic tool for AutoIt.

Rework _ProcessIdPath() to return the element $objItem.CommandLine instead of $objItem.ExecutablePath to get the full command line with parameters.

Larry wrote a function similar to _ProcessIdPath() - Get Process Name From PID that uses DLLCall instead of WMI that's significantly faster, but you'd have to ask him if the function can be adapted to return the full command line instead of the full path of the process's EXE.

Edited by JerryD

Share this post


Link to post
Share on other sites

Here is my take on what is being asked for...

is it possible to pass to autoit the shortcut name [a desktop or menu shortcut name like "Notepad" has a target line of "%SystemRoot%\system32\notepad.exe"] that invoked the program [like notepad]?

Ex:

I [manually] call [start?] the program [notepad] from two diffrent shortcuts each with diffrent -aruguments.

[notepad c:\somefile.txt]

[notepad c:\someotherfile.txt]

Im wanting to read [via AutoIt after notepad was started manually] -aruguments off the shortcut [that started it] but i cant figure out which one called [started] it.

Because if AutoIt is "calling" "the program" with arguments, then AutoIt would already know which way it was "called"... unless the OP just needs an example of setting a flag for use later on in a script?

...and if "the program" is an AutoIt script and the OP is starting it with arguments, then the OP already knows about the command line parms for AutoIt - or maybe not. My crystal ball is broken today.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0