>>7587
>In my gross tech ignorance, I once day just felt I'd found a porn image I really, unironically liked. Wasn't sure how to sort it beyond my broadly-named ~5 porn folders. So I created a specific folder for it, and put a shortcut to the image in it. And that started my really inefficient sorting method.
Ok. So this post was me. It was actually horrifying converting this sorting method to Hydrus, since Hydrus couldn't fetch target images from a shortcut fed to it. I opened a folder full of shortcuts in Irfanview, but it saw nothing. My only recourse as far as I could tell at that point was to manually open each and every shortcut in a browser (my choice was Firefox,) and manually resave each and every image. Which was exactly what I did for the first 305 folders, and 9,652 files (shortcuts; I just highlighted everything then looked at Windows properties for this number). Until I asked for help in 4chan /g/'s /sqt/ thread, and an anon replied saying he'll take a crack at it. It was like that scene in Bleach, where that asshole character offered to save Rukia, but seconds later said he was joking, so Rukia lost resolve she never knew she still had, and she screamed in anguish on the spot. I basically didn't want to do this anymore after this anon showed up. I had 62 folders left, and 4,107 files (shortcuts) left, since I was going chronologically reversed order, so the older ones were more dense with sorting, and poor sorting.
MAKE BACKUPS BEFORE ATTEMPTING ANY OF THE FOLLOWING
Anon told me to run the following in powershell:
https://archive.rebeccablacktech.com/g/thread/65734824/#65747352
#must be run from admin prompt as it modified the registry
Set-ExecutionPolicy RemoteSigned;
And then run the following in powershell as well*:
(*note: "Set $simulate = $false when you want to actually run it, $simulate = $true will just output the actions it will take." He says this alongside an earlier draft of the following script)
https://archive.rebeccablacktech.com/g/thread/65747475/#65747990
$simulate = $true;
$directory = "D:\inc\test shortcuts";
$shortcuts = gci -Path $directory -Recurse -Filter *lnk;
$shell = New-Object -ComObject WScript.Shell;
foreach ($shortcut in $shortcuts) {
$link = $shell.CreateShortcut($shortcut.FullName);
echo "copy $($link.TargetPath) $($shortcut.Directory.FullName)";
echo "rm $($shortcut.FullName)";
if ($simulate -ne $true) {
try {
copy -LiteralPath $link.TargetPath $shortcut.Directory.FullName -ErrorAction Stop;
rm -LiteralPath $shortcut.FullName;
} catch {
write-host -ForegroundColor Red "Error replacing shortcut, skipping.`n$($_.Exception)";
}
}
}
This works perfectly for turning shortcuts into their original target files, provided the shortcuts aren't broken. The original targets are still left intact, so I was able to use his earlier script, give feedback of it failing, to which he amended it, and I was able to run the better script without problems. The only thing is the shortcuts folder itself is overwritten, and any broken shortcuts are lost, hence why you should make a backup before attempting this, so the data is not lost forever.
I realize literally no one in the history of time will ever sort things this way, but just for archival purposes I wish to share it, since I googled for literally an hour- the archives there tell the tale- and I found no answer for my situation. In the end, Hydrus might one day undermine this problem, so even my unique case will have extreme ease converting to Hydrus. Today, though, I needed this script. Also, full disclosure, I am the anon from the Q&A thread >>8720 who delayed switching to Hydrus for four months, since 4chan's /g/ introduced me to it, and their elitist bullying attitude made me try extremely hard to make sure I wouldn't fuck up on my own, since they would be so apprehensive to helping me if I needed help. I'm too shy to read the reply I got in that thread. I'm too shy, also, to read anon's reply to my thanking him for the script working on /g/, since others seeing my autistic folder names for my shortcut sorting (which I slightly shared to him) makes me cold sweat. I'm a ball of anxiety, really. Thanks for your tolerating me, if you do.