Thursday, June 24, 2004

Launched from a shortcut?

If you would EVER need a way to check if your application was launched from a shortcut, rather than accessing the EXE itself, this article should help.

Now why you would want to do this is, frankly, beyond my imagination. The only thing I can think of is that on XP/2000, you can choose to run a program with different credentials through a shortcut. Even here you can't specify the credentials - the user gets to choose them (and enter a username/password) And the user can actually choose the *same* credentials as the logged on user, even with this flag set.

This is the programming equivalent of saying "There may be someone else on the computer right now, or maybe not.". Which might not be the lifesaver we're all looking for. (And no, we don't get them in India. The famous mints here are "polo" and "minto", if you're curious. Which you probably aren't, but I'm bored to death of the programming stuff) If anyone knows what scenerio such code might be useful in, I'd really appreciate a hint...

1 Comments:

Blogger Deepak Shenoy said...

I guess there are the advantages of shortcuts for users, like you said - different working directories and different credentials (the latter can be supplied by a "runas" command also). From an application point of view, it's probably not very important to find out what you used to access it.

Come to think of it - what if an application was run "remotely" through a shortcut? Could I find out where that shortcut was, and if it's on a desktop, actually identify the user's login? (the path to the desktop on Win2k/XP will have the login) Assuming of course that this is not the user that logged in to the remote machine. Have to check.

8:55 PM  

Post a Comment

<< Home