Thanks. Though I do not have any more idea. I do not think there's anything wrong on WinSCP side. Sorry.
- martin
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
I:\vps116136>icacls faulkner
faulkner No permissions are set. All users have full control.
Successfully processed 1 files; Failed processing 0 files
I:\vps116136>
< 2025-10-15 02:10:53.334 Script: Synchronizing...
. 2025-10-15 02:10:53.334 Synchronizing local directory 'I:\vps116136\faulkner\59forum\vendor\' with remote directory '/home/faulkner/public_html/59forum/vendor/', params = 0x3 (Delete, NoConfirmation)
< 2025-10-15 02:10:53.477 Script: Error deleting file 'I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Storage\Exception'.
< 2025-10-15 02:10:53.477 System Error. Code: 5.
< 2025-10-15 02:10:53.477 Access is denied
I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Storage>icacls Exception
Exception No permissions are set. All users have full control.
Successfully processed 1 files; Failed processing 0 files
I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Storage>
icacls ... /reset /T
?
< 2025-10-14 10:53:53.754 Script: Synchronizing...
. 2025-10-14 10:53:53.754 Synchronizing local directory 'I:\vps116136\faulkner\59forum\vendor\' with remote directory '/home/faulkner/public_html/59forum/vendor/', params = 0x3 (Delete, NoConfirmation)
< 2025-10-14 10:53:53.770 Script: Error deleting file 'I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Service'.
< 2025-10-14 10:53:53.770 System Error. Code: 5.
< 2025-10-14 10:53:53.770 Access is denied
. 2025-10-14 10:53:53.770 Script: Failed
. 2025-10-14 10:53:53.770 Script: Exit code: 1
I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Service>dir
Volume in drive I is Data Drive
Volume Serial Number is BCC8-BC56
Directory of I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Service
07/24/2024 10:21 AM <DIR> .
07/24/2024 10:21 AM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 1,025,259,339,776 bytes free
I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Service>cd ..
I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common>rmdir Service
Access is denied.
icacls I:\vps116136\faulkner /reset /T
Http
D:NO_ACCESS_CONTROL
Http
D:NO_ACCESS_CONTROL
icacls I:\vps116136\faulkner\...
? And then again after you recreate it (when it can be deleted)?
< 2025-10-13 12:04:02.106 Script: Error deleting file 'I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Http'.
< 2025-10-13 12:04:02.106 System Error. Code: 5.
< 2025-10-13 12:04:02.106 Access is denied
Exception
too (and possibly later also Uri
) and see what happens.
Synchronizing...
Error deleting file 'I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Http\Exception'.
System Error. Code: 5.
Access is denied
Error deleting file 'I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Http\Client'.
System Error. Code: 5.
Access is denied
Just to make sure I understand it correctly:
WinSCP fails to delete a particular local empty folder. Even after repeatedly running the same synchronization – still fails on the same folder.
You then delete the folder manually (in Windows Explorer), recreate the same folder – and then WinSCP is able to delete it. Is my understanding correct?
Also when the script is not able to delete the folder, is WinSCP GUI able to delete it? Both manually when selecting it in file panel and automatically by running the synchronization in GUI.
...
Synchronizing...
Local 'c:\Users\dan\Documents\folder\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Http' <= Remote '/home/faulkner/folder/59forum/vendor/lusitanian/oauth/src/OAuth/Common/Http'
'c:\Users\dan\Documents\folder\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Http\Client' deleted
...
winscp> pwd
/home/faulkner/folder/a/b/c/d/e/f/g/h/i/j/k/l
winscp> cd ../../../../../../../..
/home/faulkner/folder/a/b/c/d
winscp> cd ../../../..
/home/faulkner/folder
winscp> synchronize local -delete -preservetime
Comparing...
Local 'C:\Users\dan\Documents\folder\a\b\c\d\e\f\g\h\i\j\k\l' <= Remote '/home/faulkner/folder/a/b/c/d/e/f/g/h/i/j/k/l'
Synchronizing...
Local 'C:\Users\dan\Documents\folder\a\b\c\d\e\f\g\h\i\j\k\l' <= Remote '/home/faulkner/folder/a/b/c/d/e/f/g/h/i/j/k/l'
'C:\Users\dan\Documents\folder\a\b\c\d\e\f\g\h\i\j\k\l\m' deleted
winscp>
C:\Users\dan>cd Documents
C:\Users\dan\Documents>mkdir folder
C:\Users\dan\Documents>cd folder
C:\Users\dan\Documents\folder>mkdir empty
C:\Users\dan\Documents\folder>"C:\Users\dan\AppData\Local\Programs\WinSCP\WinSCP.com"
winscp> open ...
Opening tunnel...
Searching for host...
Connecting to host...
Authenticating...
Using username "faulkner".
Authenticating with public key "Dan's MVPS" from agent.
Authenticated.
Connecting through tunnel...
Searching for host...
Connecting to host...
Authenticating...
Using username "faulkner".
Authenticating with public key "Dan's MVPS" from agent.
Authenticated.
Starting the session...
Session started.
Active session: [1] faulkner@127.0.0.1
winscp> cd /home/faulkner
/home/faulkner
winscp> mkdir folder
winscp> cd folder
/home/faulkner/folder
winscp> synchronize local -delete -preservetime
Using configured transfer settings different from factory defaults.
Comparing...
Local 'C:\Users\dan\Documents\folder' <= Remote '/home/faulkner/folder'
Synchronizing...
Local 'C:\Users\dan\Documents\folder' <= Remote '/home/faulkner/folder'
'C:\Users\dan\Documents\folder\empty' deleted
winscp>
cd /d %USERPROFILE%\Documents
mkdir folder
cd folder
mkdir empty
"C:\Users\dan\AppData\Local\Programs\WinSCP\WinSCP.com"
open ...
cd /home/faulkner
mkdir folder
cd folder
synchronize local -delete -preservetime
empty
folder?
Synchronizing...
Error deleting file 'I:\vps116136\faulkner\59forum\vendor\lusitanian\oauth\src\OAuth\Common\Http\Client'.
System Error. Code: 5.
Same way, if you re-run the synchronization after the error (from the same WinSCP instance), does it complete or fail the same way on the same folder?
If you run the synchronization manually from WinSCP scripting console (so that WinSCP does not exit on the error) – can you delete the folder after the error from other application without exiting WinSCP? (to check if WinSCP has the folder locked somehow).
example.txt
to winscp>
I:\vps116136>C:\Users\dan\AppData\Local\Programs\WinSCP\WinSCP.com
winscp>
/script
and /log
parameters, I get "Unknown command". I will continue to review the documentation...
I:
drive? Is it a local drive?
/log=C:\path\to\winscp.log
command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.