I’m using Syncthing on Windows 10. I have setup external file versioning for each folder in Syncthing as I want files deleted on my remote device to be sent to recycle bin on Windows instead of being permanently deleted. (Correct me if I’m wrong, but Syncthing doesn’t provide a built-in way to do this)
Code:
:: The parameters we get from Syncthing, '~' removes quotes if any
set FOLDER_PATH=%~1
set FILE_PATH=%~2
:: Finally move the file to recycle bin
nircmd moverecyclebin "%FOLDER_PATH%\%FILE_PATH%"
The problem is, the script of external file versioning failed for some of he files due to them having special characters. Sample filename : .Shared\2Phmqcd1Ca7r8STOstOWEpjwYvHiz0XBlKGTybYAs-8=.thumb.tmp Now I’m stuck with the folder being Out of Sync, have no idea how to resolve this.
Made no difference. Still getting error. It changed from exit status 2 to exit status 0xfffd0000
I copied the code exactly like in the website.
# PowerShell has no native method to recycle files, so we use Visual
# Basic to perform the operation. If succeeded, we also include the
# recycled file in the Syncthing's DEBUG output.
Add-Type -AssemblyName Microsoft.VisualBasic
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile($args,'OnlyErrorDialogs','SendToRecycleBin')
if ($?) {
Write-Output ("Recycled " + $args + ".")
}
Ok, it’s working now. As soon as I setup the powershell script, my Bitdefender AV went haywire and blocked everything… SyncTrayzor, Syncthing, the powershell script, the files it sent to recycle bin.
I had excluded all, but some things were still blocked. After a restart it started working. Thanks