I want to make 'link'

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
aksmfakt132
Junior Member
Junior Member
Posts: 38
Joined: 2018-06-04, 13:18 UTC

I want to make 'link'

Post by *aksmfakt132 »

I copied the address of the folder I wanted to the clipboard.

Right-click on an empty space in the folder you want and click New -> lnk
You can create a link. I can paste it there.


I want to control this series of processes with the keyboard
What should I do?
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: I want to make 'link'

Post by *petermad »

In TC you can highlight the folder and press Ctrl+Shift+F5 - then TC will offer to make a a link to the folder in the opposite panel.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: I want to make 'link'

Post by *MVV »

Well, there is no internal TC command for creating LNK, but it seems that it is not so hard to trigger Windows LNK creating dialog where you can insert path to link target from clipboard:
1. You need an empty LNK file in target dir, e.g. NewLinkHere.lnk.
2. You need to execute following command: rundll32.exe appwiz.cpl,NewLinkHere "X:\Path\NewLinkHere.lnk"

So you can use e.g. this button:

Code: Select all

Command: cmd.exe
Parameters: /c "copy nul "%P\NewLinkHere.lnk" & rundll32.exe appwiz.cpl,NewLinkHere %PNewLinkHere.lnk"
Run minimized: Yes
It will open standard Windows link creation dialog for creating a LNK in active panel.
aksmfakt132
Junior Member
Junior Member
Posts: 38
Joined: 2018-06-04, 13:18 UTC

Re: I want to make 'link'

Post by *aksmfakt132 »

MVV wrote: 2018-07-23, 13:35 UTC Well, there is no internal TC command for creating LNK, but it seems that it is not so hard to trigger Windows LNK creating dialog where you can insert path to link target from clipboard:
1. You need an empty LNK file in target dir, e.g. NewLinkHere.lnk.
2. You need to execute following command: rundll32.exe appwiz.cpl,NewLinkHere "X:\Path\NewLinkHere.lnk"

So you can use e.g. this button:

Code: Select all

Command: cmd.exe
Parameters: /c "copy nul "%P\NewLinkHere.lnk" & rundll32.exe appwiz.cpl,NewLinkHere %PNewLinkHere.lnk"
Run minimized: Yes
It will open standard Windows link creation dialog for creating a LNK in active panel.

wow thanks!
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: I want to make 'link'

Post by *petermad »

2MVV
For some reason, if here is a .bat or an .exe file with the same name as the folder I want to make a link to, then your function creates a link to the .bat or .exe file in stead of to the folder.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: I want to make 'link'

Post by *MVV »

aksmfakt132 wrote: 2018-07-23, 17:49 UTC wow thanks!
Hope that helps. :)
petermad wrote: 2018-07-23, 19:00 UTC For some reason, if here is a .bat or an .exe file with the same name as the folder I want to make a link to, then your function creates a link to the .bat or .exe file in stead of to the folder.
I don't pass path to target so it seems to be a Windows iterface problem. Have you tried standard Windows LNK creation command? Do you have enabled extensions for known file types?

Just tried it in my Windows 7 with enabled extensions for known file types (I always enable it everywhere). Yes, this interface gives a higher priority to executable files than to folders, even if I insert path to a folder with trailing slash, and it works so when I trigger this function from Explorer too. :D

Well, there is also a way to create a LNK via PowerShell script, and I sure it doesn't have such problems, but it was a bit harder to find out. :)
Post Reply