【问题标题】:Create Shortcut to the Latest File of a Folder in Windows在 Windows 中创建文件夹最新文件的快捷方式
【发布时间】:2013-01-13 15:55:53
【问题描述】:

有没有办法创建快捷方式总是指向 Windows 中文件夹的最新(或最大等)?

例如:
文件夹/文件 1   2012-01-01 xxx
文件夹/文件2   2013-01-01 xxx

文件夹/快捷方式 -> 指向文件 2

编辑file1后:

文件夹/文件 1   2013-02-01 xxx
文件夹/文件2   2013-01-01 xxx

文件夹/快捷方式 -> 指向文件 1

【问题讨论】:

  • 不,没有。快捷方式基于文件名和位置以及校验和。无法创建自动更改为文件夹中最新文件的快捷方式。 (顺便说一句,这似乎不是一个编程问题。它似乎更像是一个操作系统问题,这在此处是题外话。)

标签: windows file directory shortcut


【解决方案1】:

您可以使用 PowerShell 脚本为您打开文件:

$dir = "C:\test_code"
$filter="*.txt"
$latest = Get-ChildItem -Path $dir -Filter $filter | Sort-Object LastAccessTime -Descending | Select-Object -First 1
Invoke-Item $latest.fullname

【讨论】:

  • 我 7 年前问过(我忘记了为什么问这个问题),但还是谢谢。
猜你喜欢
  • 2022-10-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-18
  • 1970-01-01
  • 1970-01-01
  • 2016-07-14
相关资源
最近更新 更多