求助一个 Windows 下文件夹挂载的问题

但是总感觉这个软件应该只是做了一个界面,实际用shell完成的功能。
能否想办法把它调用的shell拉出来破解,这样咱们用脚本也能实现相同的功能了。
我的失败尝试: 寻找 Visual Subst 的平替软件 - 讨论分享 - 小众软件官方论坛

20241111进展:

搜索到资料:

https://superuser.com/posts/1475575/revisions

根据资料做了reg文件导入,没有实现一样的效果:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
"D:"="\\??\\C:\\VirtualDisk\\D"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{9147E464-33A6-48E2-A3C9-361EFD417DEF}]
"RelativePath"="D:\\"
"Category"=dword:00000004
"Name"="D_Mapped_Drive"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder\{9147E464-33A6-48E2-A3C9-361EFD417DEF}]
"MaxCapacity"=dword:0000c7eb
"NukeOnDelete"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{9147E464-33A6-48E2-A3C9-361EFD417DEF}]
"RelativePath"="D:\\"
"Category"=dword:00000004
"Name"="D_Mapped_Drive"

[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder\{9147E464-33A6-48E2-A3C9-361EFD417DEF}]
"MaxCapacity"=dword:0000c7eb
"NukeOnDelete"=dword:00000000

https://superuser.com/a/1627998
我试了一下这个方法是可以的,就是没有那么优雅

研究了下没搞懂……

打开你的用户文件夹,右键单击随意一个系统自带文件夹(比如音乐或者下载),然后属性-位置,改为你映射的文件夹,应用,选择不移动,再在你映射的盘下删除文件就会到回收站里

的确可以建立回收站. 而且回收站属性里也能看到这个网络驱动器.

但是没有回收效果, 删除的文件并不会移入回收站.

Windows可以试试这个Powershell脚本(仅看到,未测试其是否能正常工作)

$WatchPath = "\\network\shared"
$RecycleBin = "\\network\shared\RecycleBin"

# 创建回收站文件夹
if (!(Test-Path -Path $RecycleBin)) {
    New-Item -ItemType Directory -Path $RecycleBin
}

# 创建文件系统监控对象
$Watcher = New-Object System.IO.FileSystemWatcher
$Watcher.Path = $WatchPath
$Watcher.IncludeSubdirectories = $true
$Watcher.Filter = '*.*'
$Watcher.EnableRaisingEvents = $true

# 处理删除事件
$Watcher.Deleted += {
    Param($source, $e)
    $TargetPath = Join-Path -Path $RecycleBin -ChildPath $e.Name
    Write-Host "文件删除: $($e.FullPath),移动到回收站:$TargetPath"
    Move-Item -Path $e.FullPath -Destination $TargetPath -Force
}

# 保持脚本运行
Write-Host "正在监控 $WatchPath,按 Ctrl+C 退出..."
while ($true) {
    Start-Sleep -Seconds 1
}

感谢 3_5105 提供的 绿色软件:
https://m.jb51.net/softs/876894.html
可以正常挂载
Snipaste_2024-11-23_22-03-26.png