Removing the "shortcut" label at end of a filename

A swapping-ground for Regular Expression syntax

Removing the "shortcut" label at end of a filename

Postby paulindr » Sat Feb 23, 2019 4:21 am

Hi.

(I LEFT THIS IN CASE IT HELPS ANYONE ELSE. PLEASE DON'T ATTEMPT TO HELP. SEE MY OWN REPLY BELOW.)

(EDITED TO CORRECT A WEIRD ERROR)

I read the "shortcut" related topics but none help, including a similar one with (critically) far less detail provided, so here's a problem I can't resolve - hoping someone can.

I've multiple files that I need to access via shortcuts. As you all know, for a file with a name format of Filename.ext

the shortcut name format is Filename.ext - Shortcut.lnk

Some of my filenames are quite long. To avoid problems with nested folders and long file names (that can create a file address too long for Windows to handle), I need to remove the useless " - Shortcut.lnk" label from all the shortcuts.

I use Bulk Rename Utility often enough to know it quite well but I cannot find how to remove the FULL shortcut label (i.e. everything that follows the file extension; " - Shortcut.lnk"). I can remove most of the label but I haven't yet found a way to remove the ".lnk"

Can anyone tell me a solution? (If nobody has a solution, the obvious alternative is for me to report this as a suggested new or extended function request.).

Thanks for a solution.
paulindr
 
Posts: 2
Joined: Sat Feb 23, 2019 3:52 am

Re: Removing the "shortcut" label at end of a filename

Postby paulindr » Sat Feb 23, 2019 5:20 am

I HAVE THE ANSWER BUT IT IS NOT A SOLUTION.

If a shortcut is viewed normally, for example, on the desktop, immediately it is created it will have the name of the original file FOLLOWED BY the label, " - Shortcut". This label can be deleted simply by clicking on the filename and removing it using selected cut or deleting individual characters. (Everyone should know this.)

So, if a filename is viewed in Bulk Rename Utility (BRU), it seems logical that the same label would be able to be removed. In BRU, the shortcut label is " - Shortcut.lnk". But if BRU is used to delete it, the ".lnk" appears not to be visible to the app so it cannot be deleted.

As I couldn't find a solution using BRU, I looked for other apps and found Flexible Renamer (FR). It had no problem deleting the entire shortcut label. HOWEVER, once this was done, the shortcuts all failed. Once the shortcut label, " - Shortcut.lnk", is removed (by FR), Windows has no idea what the remaining file is and cannot do anything with it.

So there is no solution to reducing the filename length by removal of the shortcut label, " - Shortcut.lnk". It's essential to Windows functionality so must not be deleted.
paulindr
 
Posts: 2
Joined: Sat Feb 23, 2019 3:52 am

Re: Removing the "shortcut" label at end of a filename

Postby therube » Sat Feb 23, 2019 12:44 pm

Since you asked ... ;-).


"Filename.ext - Shortcut.lnk" is the "full" filename, if you will.

"Filename.ext - Shortcut" is the name.
".lnk" is the file extension.

Windows, by default, hides the extensions of known file types.
A file utility program, a file renamer lets say, may or may not respect that option, or may have an option to override that setting.
(How to Force Windows Explorer to Always Show You the File Extensions)

If you remove the ".lnk" file extension from a filename, then Windows will no longer know the file is a .lnk, so its function as a .lnk will cease.
(Replace the .lnk part & it will work again.)

Further BRU has the option to allow rename actions affect the file extension too - or not.
(Rename Options -> Ignore --> File/Folder Extension)

So if you wanted to remove only the " - Shortcut" part from a filename, you could use:

3:Replace
Code: Select all
Replace:  <s>-<s>Shortcut
With: <null>

(<s> being a representation of a space character, & <null> being nothing.)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to Regular Expressions