Welcome Guest.   Make a donation to an author on the site April 21, 2014, 09:51:28 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2012! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Create Shortcut on the Destop (hopefully not as stupid as it sounds)  (Read 6427 times)
jdd
Charter Member
***
Posts: 214


see users location on a map View Profile Give some DonationCredits to this forum member
« on: February 28, 2010, 07:28:58 PM »

It would be very helpful to have an autohotkey script which sends a shortcut to the desktop. 

In other words, if a file is highlighted in Windows Explorer and I run the script (i.e. run the script in FARR) , it will create a shorcut on the destop.  I realize that I can right click on the file and use SendTo in the context menu but this process is very, very slow on my machine.  embarassed

Thanks,
jdd
Logged
EĆ³in
Charter Member
***
Posts: 1,400


O'Callaghan

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: February 28, 2010, 08:26:14 PM »

Would that really be faster than right-click dragging a file onto the desktop which offers creating a shortcut as an option?

Alternatively if you browse the the Send to folder (copy and paste "%APPDATA%\Microsoft\Windows\SendTo" in an explorer window address bar) you can make copies of the "Desktop (create shortcut)" shortcut anywhere you like and dropping files from explorer onto that shortcut makes desktop shortcuts.

Also I'd really recommend looking into why your send to menu is so slow.
Logged

Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.
PhilB66
Supporting Member
**
Posts: 1,510


View Profile Give some DonationCredits to this forum member
« Reply #2 on: March 01, 2010, 12:40:34 AM »

Have a look in these threads:

http://www.donationcoder....16484.msg146021#msg146021
http://www.donationcoder....m/index.php?topic=13780.0
http://www.donationcoder....m/index.php?topic=14493.0
Logged
jdd
Charter Member
***
Posts: 214


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #3 on: March 01, 2010, 06:41:12 AM »

EĆ³in: When I right click on a file, it takes approximately 5 seconds for the context menu to open.  Any idea why this would happen.  I have a 2-yr old Dell lap top with decent processor and 2 gig RAM running with Windows XP .

PhilB66:  Thanks for the suggestions but they do not do what I am looking for.  All of them involve using context menu or multiple steps which is what am trying to avoid.

Logged
skwire
Moderator
*****
Posts: 3,905



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: March 01, 2010, 07:27:04 AM »

Here you go.  Works with files, folders, single and multiple selections.  Change the shortcut to whatever you'd like (ctrl-d is default).

Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. ^d::
  2. {
  3.    ; Save current clipboard contents for restoration later.
  4.    Clipboard_Saved := ClipboardAll
  5.  
  6.    ; Clear clipboard
  7.    Clipboard := ""
  8.  
  9.    ; Get Explorer selection to the clipboard.
  10.    SendInput, ^c
  11.  
  12.    ; Wait up to three seconds for the clipboard to contain data.
  13.    ClipWait, 3
  14.  
  15.    ; Error-checking for the ClipWait.
  16.    If ( ErrorLevel != 0 )
  17.    {
  18.        MsgBox, The Clipboard timed out.
  19.        Return
  20.    }
  21.  
  22.    ; Create shortcuts.
  23.    Loop, Parse, Clipboard, `n, `r
  24.    {
  25.        If ( A_LoopField != "" )
  26.        {
  27.            SplitPath, A_LoopField, , OutDir, , OutNameNoExt
  28.            FileCreateShortcut, % A_LoopField, % A_Desktop . "\" . OutNameNoExt . ".lnk", % OutDir
  29.            Sleep, 1
  30.        }
  31.    }
  32.  
  33.    ; Restore clipboard.
  34.    Clipboard := Clipboard_Saved
  35.  
  36.    ; Free memory.
  37.    Clipboard_Saved := ""
  38. }
« Last Edit: June 03, 2010, 12:20:57 AM by skwire » Logged

EĆ³in
Charter Member
***
Posts: 1,400


O'Callaghan

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: March 01, 2010, 08:19:41 AM »

jdd, you probably have a slow or buggy shell extension installed. Try using the excellent ShellExView to disable them and then re enable one by one until you identify the culprit. If you sort by type you can probably just concentrate on the context menu ones.

Note after you disable/enable an extension you need to restart explorer.exe. One way to do so is kill the process through taskmanager and then still in taskmanger chose New task and type explorer. There may also be an easier way someone here knows smiley
Logged

Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.
jdd
Charter Member
***
Posts: 214


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: March 01, 2010, 08:32:52 AM »

I use Autohotkey.  Can you translate the script from AutoIt?
Logged
tomos
Charter Member
***
Posts: 8,062



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: March 01, 2010, 08:55:55 AM »

I use Autohotkey.  Can you translate the script from AutoIt?

I dont know why it says AutoIT (I think it's the nearest option in the drop-down code-highlighting when posting). Skwire's scripts normally work as AHK files (& are ahk I'm fairly sure)
Logged

Tom
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,156



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: March 01, 2010, 08:59:42 AM »

Quote
I use Autohotkey.  Can you translate the script from AutoIt?

jdd,

That is an ahk script.
the line:
"Formatted for AutoIt with the GeSHI Syntax Highlighter v1.0.8.4 [copy or print]"
is a little misleading.
If you click on the word "copy" in that line you'll be able to transfer the script to your own machine, naming it what you like.

I'd be quick to take EĆ³in's advice, you almost certainly have a 'bad' shell extension. Finding and removing that will make your computer days a lot less annoying.
Logged

Chris
skwire
Moderator
*****
Posts: 3,905



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #9 on: March 01, 2010, 09:13:32 AM »

I use Autohotkey.  Can you translate the script from AutoIt?

As tomos and cranioscopical mentioned, that is AHK code.  The AutoIt highlighter is the closest we have to an AHK highlighter.  Apologies for the ambiguity.
Logged

AndyM
Charter Member
***
Posts: 615


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #10 on: March 01, 2010, 10:47:04 AM »

Note after you disable/enable an extension you need to restart explorer.exe. One way to do so is kill the process through taskmanager and then still in taskmanger chose New task and type explorer. There may also be an easier way someone here knows
NirSoft has a utility that restarts explorer:
http://www.nirsoft.net/utils/restart_explorer.html

Logged
jdd
Charter Member
***
Posts: 214


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #11 on: March 01, 2010, 05:56:07 PM »

skwire

Worked like a charm.  However, my preference would be that the script is not always running in the tray. 

Is it possible to add an option so that the script can be executed as an alias in FARR, and closes after the shortcut is created on the desktop?
Logged
skwire
Moderator
*****
Posts: 3,905



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #12 on: March 02, 2010, 05:57:40 AM »

Is it possible to add an option so that the script can be executed as an alias in FARR, and closes after the shortcut is created on the desktop?

Do you not run a main AHK script of any sort?  This is a simple hotkey that can be integrated into any AHK script.

See post below...
« Last Edit: March 02, 2010, 07:22:18 AM by skwire » Logged

skwire
Moderator
*****
Posts: 3,905



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #13 on: March 02, 2010, 07:19:53 AM »

Here's a FARR alias package for it:

http://skwire.dcmembers.c...ks/DesktopShortcutter.zip

Unpack that to your FARR Installed or MyCustom folder and type goreload into FARR.  The default alias is ds and the application is designed to activate the last active window before FARR.  In other words, focus your Explorer (or any file manager) window, make your selection, activate FARR, type ds, and press enter.  Shortcuts of your selection should appear on the desktop.  Let me know how it works out for you.  Thanks.
Logged

jdd
Charter Member
***
Posts: 214


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #14 on: March 02, 2010, 09:05:23 AM »

It works in Windows Explorer but not my preferred file manager which is XPlorer2.  When I try it in XPlorer2, it maximizes my browser (Firefox), and pops open an error message that says "The clipboard timed out".


* desktopshorter.bmp (143.12 KB, 290x168 - viewed 170 times.)
Logged
skwire
Moderator
*****
Posts: 3,905



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #15 on: March 02, 2010, 10:06:08 AM »

I downloaded and installed Xplorer2 and it works fine here.  However, I've uploaded a new version that allows you to specify the clipboard timeout amount.  Re-download using the same URL and you can now adjust the timeout like this in your alias:

Desktop Shortcutter | %ALIASDIR%\DesktopShortcutter.exe %LASTHWND% 5 /ICON=icons\Desktop.ico

You can change that 5 (timeout in seconds) to whatever number will work on your system.  You may have to experiment a little.  As for Firefox maximising, I have no idea.  I am running Firefox as well and haven't seen that behaviour.
Logged

jdd
Charter Member
***
Posts: 214


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #16 on: March 02, 2010, 10:32:09 AM »

Perfect!   Thmbsup  It dosn't maximize Firefox anymore. Thanks.
Logged
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,022



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: March 03, 2010, 06:19:27 AM »

EĆ³in: When I right click on a file, it takes approximately 5 seconds for the context menu to open.  Any idea why this would happen.  I have a 2-yr old Dell lap top with decent processor and 2 gig RAM running with Windows XP .

Take EĆ³in's advice, and if you are still having issues with it, read on...

A lot of software likes to stick entries on that SendTo menu (and the "New" menu), and the more stuff you have there the longer it takes to show the menu.

Might want to clean it up if that happens to be your issue.

There is lots of stuff you will never use and cleaning it up not only makes it faster, it makes it easier to find the entry on the menu that you are looking for. Just make sure you are not deleting any of the original stuff.

Keep these (yours may or may not have those odd file extensions showing, depending on how your system is configured):
  • Compressed (zipped) Folder.ZFSendToTarget
  • Desktop (create shortcut).DeskLink
  • desktop.ini
  • Mail Recipient.MAPIMail
  • My Documents.mydocs
(this is from XP, there may be more with Vista/Win7)

Another thing that could cause it to be slow is an issue with one or more of your drives (very large single partition external drives are great for causing this), or having an unusually large number of drive letters it will have to add to the menu. (If you are up to W like I am, you'll be waiting a little bit for that SendTo menu to show)
Logged

mouser
First Author
Administrator
*****
Posts: 32,678



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: March 03, 2010, 07:37:16 AM »

app and Eoin are right.

there are some nice articles and utils to help you diagnose this.
for example:

http://www.watchingthenet...-problems-in-windows.html
http://windowsxp.mvps.org/slowrightclick.htm
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.074s | Server load: 0.01 ]