OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

English support forum

Moderators: petermad, Stefan2, Hacker

fc62
Junior Member
Junior Member
Posts: 64
Joined: 2007-02-06, 16:30 UTC

OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *fc62 »

Hello everyone,
I would like to report a recent change in OneDrive behavior (starting from April 2026) that is creating a significant issue in my daily workflow.
After contacting Microsoft support, I received confirmation that:

.lnk files (Windows shortcuts) are no longer supported for synchronization via OneDrive desktop client (by design, not a bug)
As a workaround, Microsoft recommends using .url files instead, which are still fully supported and synchronized across devices

This is a major limitation for me because I heavily rely on .lnk files both for personal and professional use (file organization, cross-folder references, workflow shortcuts, etc.). The suggested workaround (.url files) is usable, but currently less user friendly and more limited compared to .lnk.

My question to the Total Commander community:
In Total Commander there is a very convenient shortcut:

Ctrl + Shift + F5 → creates .lnk shortcuts quickly

👉 Is there any equally fast method, command, plugin, or script to create .url links in a similar way?

Ideally, I am looking for:
- A keyboard shortcut
- Or a batch / customizable command
- Or a plugin solution


Any suggestion or workaround would be greatly appreciated, as this change in OneDrive is forcing me to rethink my entire workflow.
Thanks in advance! 🚀
User avatar
beb
Power Member
Power Member
Posts: 762
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *beb »

2fc62

Lol. Really?!
I've just checked, I have hundreds of .lnk files in OneDrive.
I experienced what I thought was a lag with some of my .lnk files a while ago, so I just packed them on one machine and then unpacked them on another, using Total Commander's synchronization tool, or so.
I thought it was a glitch, but it turned out to be by design. Microsoft is not going to stop delivering...

Thanks for the information.

I definitely will do something with that.

As a temporary, quick solution of a last resort, I can offer a script that makes a backup of all .lnk files in the cloud as a zip archive (which keeps the directory structure of the cloud), so it can be happily synchronized.

backup_lnk_link_files_in_OneDrive_7zip.ps1

Code: Select all

$time = [diagnostics.stopwatch]::StartNew()
$env:Path+=";$env:commander_path\plugins\app\7zip"
$stamp = Get-Date -format 'yyyyMMdd_HHmmss'

# backup name
$zip = [IO.Path]::combine($PSScriptRoot,'OneDrive_link_files_backup_'+$stamp+'.zip')

# backup command
7z a -aoa -y -bso0 -tzip -ssw -stl -ssp $zip -ir!"$env:OneDrive\*.lnk"
''
# finalize
$time.Stop()
'{0:mm\:ss\.fff} by {1}' -f $time.Elapsed,$MyInvocation.MyCommand.Name
sleep -s 7
Just place it somewhere in the cloud and run.
Then you will be able to refresh the files in question on your machines from the backup archive(s).
It took a couple of seconds to back up all the .lnk files within a terabyteish cloud on my 14-year-old laptop.
Then it takes something about ten plus seconds to compare the backup archive and the cloud contents in Total Commander's synchronization tool, filtered by *.lnk.
Last edited by beb on 2026-05-25, 20:40 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including beta] x86/x64 on Win10 x64/Windows 11/Android 17
fc62
Junior Member
Junior Member
Posts: 64
Joined: 2007-02-06, 16:30 UTC

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *fc62 »

Many Thanks Beb for your temporary solution.
At the moment, however, I am using RaiDrive, which I have connected to my OneDrive account by creating a network drive that links directly to the OneDrive cloud, even though in Total Commander it appears as a normal directory structure.
This way, I create the links directly in the cloud without going through the OneDrive Desktop synchronization process.
Of course, it is a bit cumbersome and not particularly fast.
In any case, I will also try your suggestion.
Certainly, a fast system to create URL-type links would probably be ideal, but for now we will make do while waiting for someone willing to develop something more specific :)
Thanks again for your suggestion.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3978
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *sqa_wizard »

So finally an example is always helpful:
What is the text for the target at the lnk file?
What shall be the according text at the resulting url file?
#5767 Personal license
fc62
Junior Member
Junior Member
Posts: 64
Joined: 2007-02-06, 16:30 UTC

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *fc62 »

Ok, As is currently done for .lnk shortcuts, I would suggest using the file name itself as the link text and, of course, using the file’s path within the file system as the URL of the link.
I’m not sure if I’ve explained myself clearly. At the moment I can only reply from my phone, but as soon as I can access my PC, I’ll send you a sample text.
User avatar
beb
Power Member
Power Member
Posts: 762
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *beb »

Well, within what I could understand, or within what I could imagine that I understood, I can offer the following:
  • a user-command (usercmd.ini):
    1. for Cross-Platform PowerShell 7+ [pwsh executable]:

      Code: Select all

      [em_make_url_files]
      cmd=pwsh -c "%commander_path%\Plugins\PowerShell\makeURLfiles.ps1"
      param=%WL '%P' '%T' %Q
    2. for Windows PowerShell 5.1 [powershell executable]:

      Code: Select all

      [em_make_url_files]
      cmd=powershell -c "%commander_path%\Plugins\PowerShell\makeURLfiles.ps1"
      param=%WL '%P' '%T' %Q
  • a user button:

    Code: Select all

    TOTALCMD#BAR#DATA
    em_make_url_files
    
    WCMICON2.DLL,17
    Make URL files
    
    
    -1
    
  • makeURLfiles.ps1 PowerShell script (supports both powershell.exe/Windows PowerShell 5.1 and pwsh.exe/Cross-Platform PowerShell 7+):
    1. A version of the script specific to the u/fc62's request.
      It substitutes $OneDrive = 'D:\OneDrive' path part with $localhost = '\\localhost\OneDrive' one in the URL=path value for the URL files whose source items are located within the OneDrive cloud.

      Code: Select all

      $time = [diagnostics.stopwatch]::StartNew()
      $path = [IO.DirectoryInfo]$pwd.path
      
      if ($path){
      'current working path'|Write-Host -f DarkGray
          $path.FullName
      }
      ''
      if ($args){
      '%WL list file'|Write-Host -f DarkGray
          $list = [IO.FileInfo]$args[0]
          $list.Name
      ''
      '%P source path'|Write-Host -f DarkCyan
          $source = [IO.DirectoryInfo]$args[1]
          $source.FullName
      
      '%T target path'|Write-Host -f DarkCyan
          $target = [IO.DirectoryInfo]$args[2]
          $target.FullName
      }
      ''
      if (-not $args){
          Write-Warning 'no parameters have been passed, exiting...'
          sleep -seconds 3
          exit
      }
      if ($args -and $list.length -le 2){
          Write-Warning '%WL list file is empty, exiting...'
          sleep -seconds 3
          exit
      }
      
      # read input list file and collect items
      $items = [IO.File]::ReadLines($list)|foreach{
         if(-not [string]::IsNullOrWhiteSpace($_)){
             $_
         }
      }
      
      if (-not $items.count){
          Write-Warning '%WL list file contains no items, exiting...'
          sleep -seconds 3
          exit
      }
      
      # OneDrive and localhost literal definitions
      $OneDrive  = 'd:\OneDrive'
      $localhost = '\\localhost\OneDrive'
      
      # process items from %WL list file
      'processing {0} items from %WL list file...' -f $items.count|Write-Host -f Yellow
      
      foreach ($item in $items){
      
      # URL address: if item is within $OneDrive change it to $localhost
      if($item -like "$OneDrive\*"){
          $URL = $item -replace [Regex]::Escape($OneDrive),$localhost
      }
      else {
          $URL = $item # otherwise leave item intact
      }
      # display current URL
      'URL={0}' -f $URL
      
      # uncomment the following line if you need URI-formatted $URL
      #$URL = ([URI]$URL).AbsoluteUri
      
      # URL file contents
          $text=[Text.StringBuilder]::new()
          [void]$text.AppendLine('[InternetShortcut]')
          [void]$text.AppendLine("URL=$URL")
      # URL file destination path and naming
          $base = Split-Path $item -leaf
          $URLfile = [IO.Path]::combine($target,"$base.url")
      # avoid naming collisions
      $counter = 1
      while ([IO.File]::Exists($URLfile)) {
          $URLfile = [IO.Path]::combine($target,"$base($counter).url")
          $counter++
      }
      # write URL file
      [IO.File]::WriteAllText($URLfile,$text,[Text.Encoding]::Unicode)
      }
      ''
      # finalize
      $time.Stop()
      '{0} items processed for {1:mm\:ss\.fff}' -f $items.count,
      $time.Elapsed|Write-Host -f DarkCyan
      'by {0}' -f $MyInvocation.MyCommand.Name
      sleep -seconds 7
      
    2. A version of the script for other users.
      It makes no substitutions in URL=path values.

      Code: Select all

      $time = [diagnostics.stopwatch]::StartNew()
      $path = [IO.DirectoryInfo]$pwd.path
      
      if ($path){
      'current working path'|Write-Host -f DarkGray
          $path.FullName
      }
      ''
      if ($args){
      '%WL list file'|Write-Host -f DarkGray
          $list = [IO.FileInfo]$args[0]
          $list.Name
      ''
      '%P source path'|Write-Host -f DarkCyan
          $source = [IO.DirectoryInfo]$args[1]
          $source.FullName
      
      '%T target path'|Write-Host -f DarkCyan
          $target = [IO.DirectoryInfo]$args[2]
          $target.FullName
      }
      ''
      if (-not $args){
          Write-Warning 'no parameters have been passed, exiting...'
          sleep -seconds 3
          exit
      }
      if ($args -and $list.length -le 2){
          Write-Warning '%WL list file is empty, exiting...'
          sleep -seconds 3
          exit
      }
      
      # read input list file and collect items
      $items = [IO.File]::ReadLines($list)|foreach{
         if(-not [string]::IsNullOrWhiteSpace($_)){
             $_
         }
      }
      
      if (-not $items.count){
          Write-Warning '%WL list file contains no items, exiting...'
          sleep -seconds 3
          exit
      }
      
      # process items from %WL list file
      'processing {0} items from %WL list file...' -f $items.count|Write-Host -f Yellow
      
      foreach ($item in $items){
      
      # get URL (can be post-processed if needed, or used as it is)
      $URL = $item
      
      # display current URL
      'URL={0}' -f $URL
      
      # uncomment the following line if you need URI-formatted $URL
      #$URL = ([URI]$URL).AbsoluteUri
      
      # URL file contents
          $text=[Text.StringBuilder]::new()
          [void]$text.AppendLine('[InternetShortcut]')
          [void]$text.AppendLine("URL=$URL")
      # URL file destination path and naming
          $base = Split-Path $item -leaf
          $URLfile = [IO.Path]::combine($target,"$base.url")
      # avoid naming collisions
      $counter = 1
      while ([IO.File]::Exists($URLfile)) {
          $URLfile = [IO.Path]::combine($target,"$base($counter).url")
          $counter++
      }
      # write URL file
      [IO.File]::WriteAllText($URLfile,$text,[Text.Encoding]::Unicode)
      }
      ''
      # finalize
      $time.Stop()
      '{0} items processed for {1:mm\:ss\.fff}' -f $items.count,
      $time.Elapsed|Write-Host -f DarkCyan
      'by {0}' -f $MyInvocation.MyCommand.Name
      sleep -seconds 7
      
    3. To explicitly get the URI-formatted paths in the URL files, if needed, uncomment the #$URL = ([URI]$URL).AbsoluteUri line (by removing the # sign at its beginning)
  • Imaginable usage scenario
    1. Place the cursor on a file or a folder, or select any number of files and/or folders in the active panel.
    2. Hit the button (or use a keyboard shortcut, set as described in a message below).
    3. Meet a URL file, or a set of URL files (depending on what was happening in phase one) in the target panel.
      That's it.


previous version
  • the script
    makeURLfiles.ps1 :: Local paths syntax version, like: URL=d:\My folder\my document.docx

    Code: Select all

    $time = [diagnostics.stopwatch]::StartNew()
    $path = [IO.DirectoryInfo]$pwd.path
    
    if ($path){
    'current and parent path'|Write-Host -f DarkGray;$path.FullName;$path|split-path}
    ''
    if ($args){
    '%WL list file'|Write-Host -f DarkGray
    $list = [IO.FileInfo]$args[0];$list.Name
    ''
    '%P source path'|Write-Host -f DarkCyan
    $source = [IO.DirectoryInfo]$args[1];$source.FullName
    
    '%T target path'|Write-Host -f DarkCyan
    $target = [IO.DirectoryInfo]$args[2];$target.FullName}
    ''
    if (-not $args){
        Write-Warning 'no parameters have been passed, exiting...'
        sleep -seconds 3
        exit
    }
    if ($args -and $list.length -le 2){
        Write-Warning '%WL list file is empty, exiting...'
        sleep -seconds 3
        exit  
    }
    
    # read input list file and collect files/folders
    '%WL list file processing...'|Write-Host -f Yellow
    $lines = [IO.File]::ReadLines($list)
    $files = foreach ($line in $lines){
        if ((Get-Item $line -force) -is [IO.FileInfo]){
        [IO.FileInfo]$line
    }}
    $folders = foreach ($line in $lines){
        if ((Get-Item $line -force) -is [IO.DirectoryInfo]){
        [IO.DirectoryInfo]$line
    }}
    
    # process files and folders if any
    $nl = [Environment]::NewLine
    
    # do something with files if any
    if ($files.count){''
    '{0} files' -f $files.count|Write-Host -f Cyan
    foreach ($file in $files){$file.FullName
    # URL contents
        $text='[InternetShortcut]'+$nl+'URL='+$file.FullName+$nl
    # destination path and naming
        $base = [IO.Path]::GetFileNameWithoutExtension($file)+'_'+$file.extension.Substring(1)
        $url = [IO.Path]::combine($target,"$base.url")
    # avoid naming collisions
    $counter = 1
    while ([IO.File]::Exists($url)) {
        $url = [IO.Path]::combine($target,"$base$counter.url")
        $counter++
    }
    # write URL file
    [IO.File]::WriteAllText($url,$text,[Text.Encoding]::Unicode)
    }}
    
    # do something with folders if any
    if ($folders.count){''
    '{0} folders' -f $folders.count|Write-Host -f Cyan
    foreach ($folder in $folders){$folder.FullName
    # URL contents
        $text='[InternetShortcut]'+$nl+'URL='+$folder.FullName+$nl
    # destination path and naming
        $base = $folder.Name+'_folder'
        $url = [IO.Path]::combine($target,"$base.url")
    # avoid naming collisions
    $counter = 1
    while ([IO.File]::Exists($url)) {
        $url = [IO.Path]::combine($target,"$base$counter.url")
        $counter++
    }
    # write URL file
    [IO.File]::WriteAllText($url,$text,[Text.Encoding]::Unicode)
    }}
    ''
    # finalize
    $time.Stop()
    '{0} files and {1} folders processed for {2:mm\:ss\.fff}' -f $files.count,$folders.count,
    $time.Elapsed|Write-Host -f DarkCyan
    'by {0}' -f $MyInvocation.MyCommand.Name
    sleep -seconds 7
    
    
    makeURLfiles.ps1 :: URI paths syntax version, like: URL=file:///d:/My%20folder/my%20document.docx

    Code: Select all

    $time = [diagnostics.stopwatch]::StartNew()
    $path = [IO.DirectoryInfo]$pwd.path
    
    if ($path){
    'current and parent path'|Write-Host -f DarkGray;$path.FullName;$path|split-path}
    ''
    if ($args){
    '%WL list file'|Write-Host -f DarkGray
    $list = [IO.FileInfo]$args[0];$list.Name
    ''
    '%P source path'|Write-Host -f DarkCyan
    $source = [IO.DirectoryInfo]$args[1];$source.FullName
    
    '%T target path'|Write-Host -f DarkCyan
    $target = [IO.DirectoryInfo]$args[2];$target.FullName}
    ''
    if (-not $args){
        Write-Warning 'no parameters have been passed, exiting...'
        sleep -seconds 3
        exit
    }
    if ($args -and $list.length -le 2){
        Write-Warning '%WL list file is empty, exiting...'
        sleep -seconds 3
        exit  
    }
    
    # read input list file and collect files/folders
    '%WL list file processing...'|Write-Host -f Yellow
    $lines = [IO.File]::ReadLines($list)
    $files = foreach ($line in $lines){
        if ((Get-Item $line -force) -is [IO.FileInfo]){
        [IO.FileInfo]$line
    }}
    $folders = foreach ($line in $lines){
        if ((Get-Item $line -force) -is [IO.DirectoryInfo]){
        [IO.DirectoryInfo]$line
    }}
    
    # process files and folders if any
    $nl = [Environment]::NewLine
    
    # do something with files if any
    if ($files.count){''
    '{0} files' -f $files.count|Write-Host -f Cyan
    foreach ($file in $files){$file.FullName
    # URL contents
        $text='[InternetShortcut]'+$nl+'URL='+([Uri]$file.FullName).AbsoluteUri+$nl
    # destination path and naming
        $base = [IO.Path]::GetFileNameWithoutExtension($file)+'_'+$file.extension.Substring(1)
        $url = [IO.Path]::combine($target,"$base.url")
    # avoid naming collisions
    $counter = 1
    while ([IO.File]::Exists($url)) {
        $url = [IO.Path]::combine($target,"$base$counter.url")
        $counter++
    }
    # write URL file
    [IO.File]::WriteAllText($url,$text,[Text.Encoding]::Unicode)
    }}
    
    # do something with folders if any
    if ($folders.count){''
    '{0} folders' -f $folders.count|Write-Host -f Cyan
    foreach ($folder in $folders){$folder.FullName
    # URL contents
        $text='[InternetShortcut]'+$nl+'URL='+([Uri]$folder.FullName).AbsoluteUri+$nl
    # destination path and naming
        $base = $folder.Name+'_folder'
        $url = [IO.Path]::combine($target,"$base.url")
    # avoid naming collisions
    $counter = 1
    while ([IO.File]::Exists($url)) {
        $url = [IO.Path]::combine($target,"$base$counter.url")
        $counter++
    }
    # write URL file
    [IO.File]::WriteAllText($url,$text,[Text.Encoding]::Unicode)
    }}
    ''
    # finalize
    $time.Stop()
    '{0} files and {1} folders processed for {2:mm\:ss\.fff}' -f $files.count,$folders.count,
    $time.Elapsed|Write-Host -f DarkCyan
    'by {0}' -f $MyInvocation.MyCommand.Name
    sleep -seconds 7
    
    
    And I also made a [System.Text.StringBuilder]-based version of the script:
    makeURLfiles.ps1

    Code: Select all

    
    $time = [diagnostics.stopwatch]::StartNew()
    $path = [IO.DirectoryInfo]$pwd.path
    
    if ($path){
    'current and parent path'|Write-Host -f DarkGray;$path.FullName;$path|split-path}
    ''
    if ($args){
    '%WL list file'|Write-Host -f DarkGray
    $list = [IO.FileInfo]$args[0];$list.Name
    ''
    '%P source path'|Write-Host -f DarkCyan
    $source = [IO.DirectoryInfo]$args[1];$source.FullName
    
    '%T target path'|Write-Host -f DarkCyan
    $target = [IO.DirectoryInfo]$args[2];$target.FullName}
    ''
    if (-not $args){
        Write-Warning 'no parameters have been passed, exiting...'
        sleep -seconds 3
        exit
    }
    if ($args -and $list.length -le 2){
        Write-Warning '%WL list file is empty, exiting...'
        sleep -seconds 3
        exit
    }
    
    # read input list file and collect files/folders
    '%WL list file processing...'|Write-Host -f Yellow
    $lines = [IO.File]::ReadLines($list)
    $files = foreach ($line in $lines){
        if ((Get-Item $line -force) -is [IO.FileInfo]){
        [IO.FileInfo]$line
    }}
    $folders = foreach ($line in $lines){
        if ((Get-Item $line -force) -is [IO.DirectoryInfo]){
        [IO.DirectoryInfo]$line
    }}
    
    # do something with files if any
    if ($files.count){''
    '{0} files' -f $files.count|Write-Host -f Cyan
    foreach ($file in $files){$file.FullName
    # URL contents
        $text=[Text.StringBuilder]::new()
        [void]$text.AppendLine('[InternetShortcut]')
        [void]$text.Append('URL=')
        [void]$text.AppendLine($file.FullName)
    # destination path and naming
        $base = [IO.Path]::GetFileNameWithoutExtension($file)+'_'+$file.extension.Substring(1)
        $url = [IO.Path]::combine($target,"$base.url")
    # avoid naming collisions
    $counter = 1
    while ([IO.File]::Exists($url)) {
        $url = [IO.Path]::combine($target,"$base$counter.url")
        $counter++
    }
    # write URL file
    [IO.File]::WriteAllText($url,$text,[Text.Encoding]::Unicode)
    }}
    
    # do something with folders if any
    if ($folders.count){''
    '{0} folders' -f $folders.count|Write-Host -f Cyan
    foreach ($folder in $folders){$folder.FullName
    # URL contents
        $text=[Text.StringBuilder]::new()
        [void]$text.AppendLine('[InternetShortcut]')
        [void]$text.Append('URL=')
        [void]$text.AppendLine($folder.FullName)
    # destination path and naming
        $base = $folder.Name+'_folder'
        $url = [IO.Path]::combine($target,"$base.url")
    # avoid naming collisions
    $counter = 1
    while ([IO.File]::Exists($url)) {
        $url = [IO.Path]::combine($target,"$base$counter.url")
        $counter++
    }
    # write URL file
    [IO.File]::WriteAllText($url,$text,[Text.Encoding]::Unicode)
    }}
    ''
    # finalize
    $time.Stop()
    '{0} files and {1} folders processed for {2:mm\:ss\.fff}' -f $files.count,$folders.count,
    $time.Elapsed|Write-Host -f DarkCyan
    'by {0}' -f $MyInvocation.MyCommand.Name
    sleep -seconds 7
    
Imaginable usage scenario
  1. Place the cursor on a file or a folder, or select any number of files and/or folders in the active panel.
  2. Hit the button (or use a keyboard shortcut, set as described in a message below).
  3. Meet a URL file, or a set of URL files (depending on what was happening in phase one) in the target panel.
    That's it.
Edit
  • Added a Windows PowerShell-based user command version (that implies using powershell[.exe] executable instead of pwsh[.exe])
  • Added a [System.Text.StringBuilder]-based version of the script
  • Added a URI paths format (like: URL=file:///d:/My%20folder/my%20document.docx) to one of the versions of the script
  • Ensured the URL files have a trailing blank line
  • Pausing timings reduced
Last edited by beb on 2026-06-05, 06:57 UTC, edited 17 times in total.
#278521 User License
Total Commander [always the latest version, including beta] x86/x64 on Win10 x64/Windows 11/Android 17
User avatar
beb
Power Member
Power Member
Posts: 762
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *beb »

If you want a keyboard shortcut for that, In the [Shortcuts] section of your wincmd.ini put something like CTRL+U=em_make_url_files (or whatever you prefer instead), or follow the GUI Configuration - Options... - Misc. - Redefine hotkeys (Keyboard remapping):

Code: Select all

[Shortcuts]
CTRL+U=em_make_url_files
Last edited by beb on 2026-05-26, 07:09 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including beta] x86/x64 on Win10 x64/Windows 11/Android 17
User avatar
beb
Power Member
Power Member
Posts: 762
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *beb »

And if you would need paths in the URLs to be explicitly like that: file:///C:/My%20Folder/my%20file.txt (although lloks like Windows converts them anyway when needed), then put these lines from the script:

Code: Select all

$text='[InternetShortcut]'+[Environment]::NewLine+'URL='+$file.FullName
$text='[InternetShortcut]'+[Environment]::NewLine+'URL='+$folder.FullName
as follows:

Code: Select all

$text='[InternetShortcut]'+[Environment]::NewLine+'URL='+([System.Uri]$file.FullName).AbsoluteUri
$text='[InternetShortcut]'+[Environment]::NewLine+'URL='+([System.Uri]$folder.FullName).AbsoluteUri
And if you'd like the URL files to have an empty trailing line, then add another +[Environment]::NewLine at the end of the lines (if so, it will be reasonable to assign a variable somewhere at the beginning, like $nl = [Environment]::NewLine, and use it further, like $text='...'+$nl+'...'+...+$nl to make it shorter).

Also, adjust the sleeping times/pauses (sleep -s[econds] 5, sleep -s[econds] 33) accordingly so the script closes faster if needed.

Edit
The updated versions of the script already include said modifications (to a certain extent).
#278521 User License
Total Commander [always the latest version, including beta] x86/x64 on Win10 x64/Windows 11/Android 17
fc62
Junior Member
Junior Member
Posts: 64
Joined: 2007-02-06, 16:30 UTC

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *fc62 »

Hi beb, and thank you very much for your suggestion.

I am trying to follow the instructions you sent me. I try to manage on my own, but I’m not very experienced with scripts, so I may have done something wrong:

- I created a user command called “em_make_url_files”
- I created a user button
- I created a file named makeURLfiles.ps1, inserted the “Local paths syntax version” script inside it, and placed it in the following folder:
c:\totalcmd\Plugins\PowerShell\makeURLfiles.ps1

I then tried it, but when I press the button I get the following error:
[File not found!
pwsh -c "c:\totalcmd\Plugins\PowerShell\makeURLfiles.ps1"
"Handel not Valid"]

Where am I going wrong?
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3978
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *sqa_wizard »

Most likely you don't have Powershell V7 installed, which uses pwsh.exe
#5767 Personal license
fc62
Junior Member
Junior Member
Posts: 64
Joined: 2007-02-06, 16:30 UTC

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *fc62 »

Ok, I just installed Powershell V7 but the problem is not solved. I have currently both version o Powershell, the old ones and the new V7. Could be this the problem?
User avatar
beb
Power Member
Power Member
Posts: 762
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *beb »

fc62 wrote: 2026-05-30, 21:54 UTC Ok, I just installed Powershell V7 but the problem is not solved. I have currently both version o Powershell, the old ones and the new V7. Could be this the problem?
2fc62
No, Cross-Platform PowerShell (7+) does not replace Windows PowerShell (5.1 and older).
By design, the new version has been made so both could happily coexist on the same system, side by side.

By the way, the script is fully compatible with Windows PowerShell (5.1).
To run the button/command/script under Windows PowerShell, just change the user command as follows:

Code: Select all

[em_make_url_files]
cmd=powershell -NoProfile -ExecutionPolicy Bypass -command "c:\totalcmd\Plugins\PowerShell\makeURLfiles.ps1"
param=%WL '%P' '%T' %Q
You can also try applying those switches to the cross-platform PowerShell-based command:

Code: Select all

[em_make_url_files]
cmd=pwsh -NoProfile -ExecutionPolicy Bypass -c "c:\totalcmd\Plugins\PowerShell\makeURLfiles.ps1"
param=%WL '%P' '%T' %Q
Also, since the script relies on the Total Commander %WL list file, the script may try to access the %WL file before it is written to disk by the TC.
Then we can try to enforce a pause for the script to wait a bit before trying to read the %WL list.
Let's start with a 3-second pause (it should be more than enough) and see what happens.
To do this, add the "Start-Sleep -seconds 3" line at the very beginning of the "c:\totalcmd\Plugins\PowerShell\makeURLfiles.ps1" script, like (the first two lines):

Code: Select all

Start-Sleep -seconds 3
$time = [diagnostics.stopwatch]::StartNew()
Last edited by beb on 2026-05-31, 21:12 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including beta] x86/x64 on Win10 x64/Windows 11/Android 17
fc62
Junior Member
Junior Member
Posts: 64
Joined: 2007-02-06, 16:30 UTC

OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *fc62 »

Hi Beb, many thanks
I applied your suggestion below, and now the script works very well!!!:
[em_make_url_files]
cmd=powershell -NoProfile -ExecutionPolicy Bypass -command "c:\totalcmd\Plugins\PowerShell\makeURLfiles.ps1"
param=%WL '%P' '%T' %Q


I would have two additional questions:
First question:
To solve the issue of different local paths with “.lnk” shortcuts, I have identified two possible solutions:

Solution 1: Set the same local path on all machines, as we do in my company.
Solution 2: Share the OneDrive folder on the local network and create links using a path like:
\\localhost\OneDrive\filename

This way, the .lnk shortcut remains valid across different machines.
I personally use the second approach regularly, so in Total Commander I browse folders via the network path \\localhost\OneDrive\....
However, if I try to create a URL link from this path, I get an error and the link does not work. Do you have any idea how to make this work?

Second question:
In Total Commander, I frequently use Ctrl+Q (or F3) to preview files — I believe this is one of its most useful features. Among the various plugins, I use ulister (lister), which gives me the best results for most file types.
It also works very well with .lnk shortcuts: if the shortcut is valid, it correctly shows a preview of the target file.
However, it does not work with URL shortcuts. Do you know of any plugin that can display a preview (via Ctrl+Q) of the linked file when using URL shortcuts?

Many thanks again for your help
User avatar
beb
Power Member
Power Member
Posts: 762
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *beb »

fc62 wrote: 2026-05-31, 18:40 UTC First question:
I have many more questions about your question than one.
Please give me a bit more time to formulate my questions so we can identify and address the issue with minimum moves.
For now, honestly, I understand nearly nothing.
fc62 wrote: 2026-05-31, 18:40 UTC Second question:
That's easier. I'm afraid there's no such a plugin in the wild.
There is the URL Shortcut Viewer plugin by Thomas Beutlich, whose latest version (wlx_urlview_1.1.1.0.zip) dates back to 2011.
The plugin claims to use the Internet Explorer browser component to display the website of URL files (Internet shortcuts) in the lister window of Total Commander.
I'm not sure it is still capable to realize its primary function on the modern machines by now, let alone to display Ctrl+Q previews of the made-up URLs we are dealing with here.
#278521 User License
Total Commander [always the latest version, including beta] x86/x64 on Win10 x64/Windows 11/Android 17
fc62
Junior Member
Junior Member
Posts: 64
Joined: 2007-02-06, 16:30 UTC

Re: OneDrive no longer syncs .lnk files (since April) – quick way to create .URL links in Total Commander?

Post by *fc62 »

OK, regarding point 1, please take all the time you need! :D

In the meantime, let me try to explain it more clearly.
To overcome the issue that OneDrive or Dropbox synchronization on a local computer may use different local directory paths, I came up with this “workaround.”
In File Explorer, I shared the folders containing my cloud-synchronized data (OneDrive, Dropbox, Google Drive) with my own local user:
Right click On The Folder → Properties → Sharing → Advanced Sharing → Permissions → select my user.

By doing this, under the path "Network → \\localhost", I can access the shared folders of OneDrive, Dropbox, and Google Drive in a consistent way.
At this point, in Explorer or Total Commander, you can access the same OneDrive folder in two equivalent ways:

local path: D:\OneDrive...
network path: \\localhost\OneDrive...

Now, if you create .lnk shortcut files using the \\localhost\OneDrive... path, those shortcuts will work on any computer where OneDrive (Or Dropbox, GoogleDrive, etc.) is synchronized, independently of the different path of the forder OneDrive, provided that you have shared said OneDrive folder with your local user as described above.

I’m not sure how to upload images on the forum—otherwise, with 2–3 screenshots I could explain it much more clearly.
Post Reply