Sign in to follow this  
Followers 0
sulfurious

filecreateshortcut - hotkey not remember on reboot

12 posts in this topic

Hi.

First and foremost, AutoIT rules. Especially when it comes to string manip. Sooooo many times I have started in vbs, only to dump it and use AutoIT. Usually because of the strenght of the string manips.

Anyway, here is something that is stumping me.

Using filecreateshortcut, with all proper paths and whatnot, also setting hotkey of "^{NumPad3}". This shortcut (.lnk) is on the desktop, and calls a compiled .au3 script in another directory. Pretty simple. It works fine when I run it. And then it does exactly what it is supposed to, doing the action on the hotkey.

But on a reboot, the hotkey is gone. The shortcut is still there and it works when ran, but no hotkey. If I make the shortcut with no hotkey, then assign if via standard right click/properties, it resumes on a reboot. I can't seem to find and answer for this one. I have yet to find a registry entry for such things.

Anyone see this before?

Thnx,

Sul

Share this post


Link to post
Share on other sites



Hi.

First and foremost, AutoIT rules. Especially when it comes to string manip. Sooooo many times I have started in vbs, only to dump it and use AutoIT. Usually because of the strenght of the string manips.

Anyway, here is something that is stumping me.

Using filecreateshortcut, with all proper paths and whatnot, also setting hotkey of "^{NumPad3}". This shortcut (.lnk) is on the desktop, and calls a compiled .au3 script in another directory. Pretty simple. It works fine when I run it. And then it does exactly what it is supposed to, doing the action on the hotkey.

But on a reboot, the hotkey is gone. The shortcut is still there and it works when ran, but no hotkey. If I make the shortcut with no hotkey, then assign if via standard right click/properties, it resumes on a reboot. I can't seem to find and answer for this one. I have yet to find a registry entry for such things.

Anyone see this before?

Thnx,

Sul

Wouldn't a script have to be running in order for a HotKey to work?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Wouldn't a script have to be running in order for a HotKey to work?

He means a Windows hotkey. Right click on a shortcut on your desktop and you will see what he is meaning.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

He means a Windows hotkey. Right click on a shortcut on your desktop and you will see what he is meaning.

Nope afraid only thing I have is Run As / Pin to start up and the rest of the normal stuff... so is there a lesson here I'm gonna learn?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Nope afraid only thing I have is Run As / Pin to start up and the rest of the normal stuff... so is there a lesson here I'm gonna learn?

I forgot to say look in properties and then in Shortcut.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yep just noticed that, guess I never had the need to play with it, but I can't find any registry options for it on the net to help out :o... (but I'm still looking).

Edit:

I guess what is throwing me off if it is a shortcut.lnk is the ('^{NumPad3}'), that's an AutoIt HotKey set, if your setting it within the shortcut area of the .lnk wouldn't it be: Ctrl + Num 3?

All in all, I've taken up needless space, and probably haven't helped a bit... sorry about that.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I am unable to duplicate the problem on WinXP Pro sp2 using the help file's FileCreateShortcut example with a recent beta of AutoIt.

If there is a bug, I blame Microsoft (*see below)

What operating system and AutoIt version are you using? Does the example in the help file exhibit the same problem? After you reboot, does the shortcut key in the file's properties actually say "None" or does it say "Ctrl + Num 3" and fail to work.

* In my experience, Windows hotkey shortcuts are buggy. For example, create a shortcut on your desktop to calc. Assign a hotkey to it, and make sure it works. Then, rename your shortcut (i.e., rename calc.exe to calc.foo). The hotkey doesn't work even though it's still listed in the shortcut properties! Rename the shortcut back to its original name and the hotkey works again.

Even more fun happens if you delete that shortcut: You are unable to assign that hotkey to any new shortcut until you reboot (restart explorer.exe)..... Or if you recreate the shortcut before rebooting and try to assign the hotkey to it, Calculator windows appear....

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Running Xp pro SP2, AutoIt beta 311. The hotkey is for the link, meaning it is the same as link properties/shortcut. It works perfectly when I make the link. Can ctl + numpad3 all day. Reboot, it does not, and the properties of the link still says Ctrl+Numpad3. If I make the hotkey manually, it stays after reboot.

here is the code:

FileCreateShortcut(@ScriptDir & "\OP_SA.exe",@DesktopDir & "\OP_SA.lnk",@ScriptDir,"","OP Stop All",@ScriptDir & "\OP_SA.exe","^{Numpad3}",0,@SW_MINIMIZE)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Running Xp pro SP2, AutoIt beta 311. The hotkey is for the link, meaning it is the same as link properties/shortcut. It works perfectly when I make the link. Can ctl + numpad3 all day. Reboot, it does not, and the properties of the link still says Ctrl+Numpad3. If I make the hotkey manually, it stays after reboot.

here is the code:

FileCreateShortcut(@ScriptDir & "\OP_SA.exe",@DesktopDir & "\OP_SA.lnk",@ScriptDir,"","OP Stop All",@ScriptDir & "\OP_SA.exe","^{Numpad3}",0,@SW_MINIMIZE)
Out of curiousity, did you try this:
FileCreateShortcut(@ScriptDir & "\OP_SA.exe",@DesktopDir & "\OP_SA.lnk",@ScriptDir,"","OP Stop All",@ScriptDir & "\OP_SA.exe","Ctrl + Num 3",0,@SW_MINIMIZE)

Edit:

Blah... nevermind, it just puts Ctrl + Shift + Ctrl + Alt or something.

I should leave you alone on this... I'm not helping at all - Sorry...

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

lol, I did the same thing the first time around. Have to use the ^ and {} to do it. I would have done this in vbs, except there is no numpad ablility for hotkeys on creating shortcuts. Actually these kind of hotkeys only work from the desktop anyway. But if you set the .lnk attribs to Hidden, you don't even see them and the hotkey works from pretty much everywhere, thus the need to use a hotkey combo that will not be invoked in a program, say maybe like office or firefox.

I am using them to set the policy on my firewall. The OP_SA.exe is an autoIT script (exe) that activates a hidden window, Alts throught the menus and sets the policy. Very quick way to do something that before took multiple mouse clicks to do.

Share this post


Link to post
Share on other sites

Had to confirm it one more time. Compiled the script with the Au2.exe from the beta folder. I assume there is no other way to compile it. Maybe that is my problem.

Regardless, recompiled OP_SA.exe. Recompiled the createshortcut script, this time including a message box as the first thing. Run the script and make the link. Hotkey works. Reboot. Hotkey does not work. Not even the msgbox, so the hotkey is not firing. Delete the shortcut. Make it the old fashioned way - send to. Manually set the shortcut to Ctrl+NumPad3. It works. Reboot, it still works.

Curiously, I have to delete all of the links created by AutoIT from the desktop and make them the old fashioned way before they can be assigned ANY hotkey. No matter what I put in it (it lets me), they will not function if AutoIT created them.

Hmmm.

Sul

Share this post


Link to post
Share on other sites

Also to note. The firewall is normally a hidden window that is only visible if the tray icon shows it. The OP_SA exe is activating it, using it, then hiding it. Normally on bootup, you only see the firewall icon and the window is hidden. However, I have noted that after creating the shortcut on the desktop to the OP_SA exe, using Ctrl+NumPad3 as the hotkey, that the window is now visible. This is not typical.

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