Author Topic: Create URL shortcut?  (Read 13152 times)

JPCoetzee

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Create URL shortcut?
« on: October 17, 2023, 10:32:50 »
If I want to create a URL shortcut I have to open an Explorer window, which is a bit laborious . I've searched high and low but can't find a way to do the same thing directly in MC.

Can anyone help? Many thanks!


Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 536
  • Old Skull
    • View Profile
Re: Create URL shortcut?
« Reply #1 on: October 17, 2023, 19:03:07 »
URL shortcut to a file? Could you explain in details? It might be possible via MultiScript.

JPCoetzee

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: Create URL shortcut?
« Reply #2 on: October 23, 2023, 11:45:28 »
1. Open a Windows Explorer window on any folder
2. Right-click > New > Shortcut
3. In the box, type or paste a URL (for example http://bbc.co.uk)
4. Click "Next"
5. Give it a name (for example "BBC")
6. Click "Finish"

Now you have a shortcut in that folder that when clicked will open your browser on the website.

AFAIK there is no way to do the same thing in MC.

thanks

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4407
    • View Profile
    • Multi Commander
Re: Create URL shortcut?
« Reply #3 on: October 23, 2023, 12:48:48 »
1. Open a Windows Explorer window on any folder
2. Right-click > New > Shortcut
3. In the box, type or paste a URL (for example http://bbc.co.uk)
4. Click "Next"
5. Give it a name (for example "BBC")
6. Click "Finish"

Now you have a shortcut in that folder that when clicked will open your browser on the website.

AFAIK there is no way to do the same thing in MC.

thanks

Never heard anybody doing that before..  You can add web urls to the favorites in MC but you can also create .lnk shortcuts in MC from the context (popup) under new section. just they wil end up empty since Windows Explorers editor will not pop up.. but just do show properties on in afterwards and you can edit it
« Last Edit: October 23, 2023, 12:51:17 by Mathias (Author) »

JPCoetzee

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: Create URL shortcut?
« Reply #4 on: October 23, 2023, 13:01:21 »
I have folders dedicated to specific documents and I always have a folder-specific URL that points to the document within a Document Management system on a server.

I can probably do it with Powershell/batch file and an MC pop-up window. I'll post my solution here.

Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 536
  • Old Skull
    • View Profile
Re: Create URL shortcut?
« Reply #5 on: October 23, 2023, 20:55:59 »
JPCoetzee, try this MultiScript

Code: [Select]
@var $shortcut_name = AskText( "Enter shortcut name:", "", 0 );

if ( 0 == StrLen( $shortcut_name ) )
{
  return;
}

//@var $url_name = GetClipboardText();
@var $url_name = "";

$url_name = AskText( "Enter shortcut URL:", $url_name, 0 );

if ( 0 == StrLen( $url_name ) )
{
  return;
}


$shortcut_name = GetSourcePath() ^ $shortcut_name + ".url";
$url_name = "URL=" + $url_name;

@var $content[];

arrayAdd( $content, "[InternetShortcut]" );
arrayAdd( $content, $url_name );

@var $result = SaveArray( $shortcut_name, $content, 0, 1 );

if ( 0 == $result )
{
  MessageBox( "Error", "URL shortcut was not created!", 0 );
}

JPCoetzee

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: Create URL shortcut?
« Reply #6 on: October 24, 2023, 09:37:46 »
JPCoetzee, try this MultiScript

Perfect! Much better than my shoddy attempts with a batch file.

Many thanks