Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #197062

Re: PSA: How to overcome the 260-character Windows shortcut field limit

From Maria Sophia <mariasophia@comprehension.com>
Newsgroups alt.comp.os.windows-10, alt.comp.os.windows-11, alt.comp.microsoft.windows
Subject Re: PSA: How to overcome the 260-character Windows shortcut field limit
Date 2026-10-16 09:20 -0700
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <11atiro$eom$1@nnrp.usenet.blueworldhosting.com> (permalink)
References <11ajida$fg6$1@nnrp.usenet.blueworldhosting.com> <nje20nFpq63U1@mid.individual.net> <16keqdc0p9edk$.c1hsh656fpf0$.dlg@40tude.net>

Cross-posted to 3 groups.

Show all headers | View raw


JJ wrote:
> On Fri, 16 Oct 2026 08:28:17 +0100, Andy Burns wrote:
>> Maria Sophia wrote:
>> 
>>> PSA: How to overcome the 260-character Windows shortcut field limit
>> Is the shortcut limit different from the general path limit?
>> 
>> If not, doesn't it go away for Win10/Win11 with a registry setting?
>> 
>> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
>> "LongPathsEnabled"=dword:00000001
> 
> That setting is only for the kernel side of the file-system handling, which
> is a relatively new software support (since Windows 10).
> 
> Applications may hard-code the 260-character limit in their own code, in
> order not to bother checking error code.
> 
> If that setting is already enabled and the system has been restarted (for
> the setting to take effect), and the shell still limit paths to 260
> characters, then the shell is not yet updated to take advantage of that
> setting. By "shell", I meant the shell library. e.g. SHELL32.DLL,
> SHLWAPI.DLL, etc.
> 
> The LNK shortcut file format itself is not limited to 260 characters for
> strings. For ANSI typed strings, they're stored as a NULL-terminated string
> (thus no length limit). For Unicode typed strings, they're stored as a
> finite string length where the length is defined as an unsigned 16-bit
> integer. Meaning that, Unicode strings can be up to 65534 bytes or 32767
> Unicode characters. Note: Windows' native Unicode format is UTF-16. Not
> UTF-8.

Wow. THANK YOU both for helping to answer the question of how to overcome
the reputed 260-character limit on shortcut TARGET field overall length.

I LOVE Andy's suggestion, but looking at JJ's clarification, it seems maybe
that LongPathsEnabled registry setting enables long paths for supported
applications' file-system operations but, from what JJ clarified, perhaps a
shortcut's command line is not a file path, so the 260-character field
limit may be coming from the shortcut editor or another shell component.

I readily publicly and openly admit that I don't understand this stuff yet,
as if I understood it, there would be no need to ask for help solving it.

Apparently the 260-character limit I'm hitting is likely not in the .lnk
file format itself but in the Windows shortcut Properties dialog, which
seems to impose its own limit on the Target field of any given shortcut.
	
Apparently these are three separate limits
 a. MAX_PATH
 b. Shortcut Target field
 c. Command-line length	

Looking them up, and trying to summarize them with respect to the limit
 a. MAX_PATH: 
    This is, apparently, only the traditional 260-character limit 
    on many Windows file paths as Andy showed that Windows 10 and 11
    can possibly support longer paths under certain conditions, 
    depending on the registry setting and application manifest.

 b. Shortcut Target field: 
    This is the limit being imposed on me by the Windows shortcut editor 
    or, as JJ noted, perhaps by other shell components but as noted, it
    is not a strict 260-character limit inherent in the .lnk file format.

 c. Command-line length: 
    Apparently this is a totally separate limit imposed by the 
    process-launching mechanism (such as the Windows CreateProcessW API 
    which allows a command line of up to 32,767 characters, including 
    the terminating null character that JJ astutely noted above).

BTW, I found five more ways to overcome the limitation, but I'm using the
batch file method (i.e., llm.bat) for now and it's working just fine.
 1. A PowerShell script with a short shortcut
     powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\data\sys\scripts\llm.ps1"
     $urls = @(
      'https://chatgpt.com/'
      'https://chat.mistral.ai/chat'
      'https://chat.qwen.ai/'
      'https://duck.ai/'
      'https://gemini.google.com/app'
      'https://lumo.proton.me/guest'
      'https://perplexity.ai/'
      'https://venice.ai/'
     )
     Start-Process msedge -ArgumentList $urls
 2. A plain text URL list and a launcher
     Get-Content 'C:\data\sys\llm-urls.txt' |
      Where-Object { $_ -match '^https?://' } |
      ForEach-Object { Start-Process msedge -ArgumentList $_ 	}
 3. A local HTML launchpad
     <!doctype html>
     <meta charset="utf-8">
     <title>LLM Search Launchpad</title>
     <h1>LLM Search</h1>
     <ul>
      <li><a href="https://chatgpt.com/">ChatGPT</a></li>
      <li><a href="https://gemini.google.com/app">Gemini</a></li>
      <li><a href="https://duck.ai/">Duck.ai</a></li>
      <li><a href="https://www.perplexity.ai/">Perplexity</a></li>
      <li><a href="https://chat.mistral.ai/chat">Mistral</a></li>
      <li><a href="https://chat.qwen.ai/">Qwen</a></li>
     </ul>
 4. A bookmark folder 
 5. A dedicated Edge profile with startup pages
     msedge.exe --profile-directory="Profile 2"
-- 
On Usenet, we pool our knowledge so everyone's a little smarter.
































.

Back to alt.comp.os.windows-10 | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

PSA: How to overcome the 260-character Windows shortcut field limit Maria Sophia <mariasophia@comprehension.com> - 2026-10-12 14:11 -0700
  Re: PSA: How to overcome the 260-character Windows shortcut field limit Maria Sophia <mariasophia@comprehension.com> - 2026-10-12 14:49 -0700
    Re: PSA: How to overcome the 260-character Windows shortcut field limit Maria Sophia <mariasophia@comprehension.com> - 2026-10-15 19:22 -0700
  Re: PSA: How to overcome the 260-character Windows shortcut field limit Andy Burns <usenet@andyburns.uk> - 2026-10-16 08:28 +0100
    Re: PSA: How to overcome the 260-character Windows shortcut field limit JJ <jj4public@gmail.com> - 2026-10-16 16:35 +0700
      Re: PSA: How to overcome the 260-character Windows shortcut field limit Maria Sophia <mariasophia@comprehension.com> - 2026-10-16 09:20 -0700
        Re: PSA: How to overcome the 260-character Windows shortcut field limit Andy Burns <usenet@andyburns.uk> - 2026-10-16 17:39 +0100
          Re: PSA: How to overcome the 260-character Windows shortcut field limit Maria Sophia <mariasophia@comprehension.com> - 2026-10-18 15:16 -0400

csiph-web