Access is denied when setting DebugLogPath
We’ve just upgraded one of our webservices (which is on a VM Server running Windows Server 2016 that used WinSCP 5.15.7 (build 10060) to 6.5.6 (build 16502 2026-03-25) and found an interesting issue.
When the end user runs the service, they get an “Access is denied” error message being returned from the C# call. Further investigation has identified that this error is being caused by the setting of the DebugLogPath
nb: filename has been changed for this post but is representative of the real values.
We know this access denied is not to do with the log file itself because the log file is written to this area for the old version and we get the start of a Debug logfile with the new version.
The last line that is recorded in this shorten log file (before the clean-up process) is:
But when an admin runs the process they get:
When we compare the log file produced by the admin with a log file produced by the old version of WinSCP it is noticeable that the “Process path: c:\windows\system32\inetsrv\w3wp.exe” line is not in the older log file. From what I can tell, this file and directory has permission for everyone to read/execute so I am not sure what file/folder the access is being denied for.
So my questions are:
TIA
When the end user runs the service, they get an “Access is denied” error message being returned from the C# call. Further investigation has identified that this error is being caused by the setting of the DebugLogPath
string DebugLogfile = "D:\Logs\DebugTESTLog.txt"; session.DebugLogPath = DebugLogfile;
We know this access denied is not to do with the log file itself because the log file is written to this area for the old version and we get the start of a Debug logfile with the new version.
The last line that is recorded in this shorten log file (before the clean-up process) is:
[2026-05-11 11:08:46.938] [0008] Assembly path: C:\inetpub\wwwroot\[location of service]\WinSCPnet.DLL
[2026-05-11 11:08:46.938] [0008] Assembly product version: 6.5.6.0
But when an admin runs the process they get:
[2026-05-11 11:23:28.490] [0021] Assembly path: C:\inetpub\wwwroot\[location of service]\WinSCPnet.DLL
[2026-05-11 11:23:28.490] [0021] Assembly product version: 6.5.6.0
[2026-05-11 11:23:28.490] [0021] Process path: c:\windows\system32\inetsrv\w3wp.exe
[2026-05-11 11:23:28.490] [0021] Session.Open entering
When we compare the log file produced by the admin with a log file produced by the old version of WinSCP it is noticeable that the “Process path: c:\windows\system32\inetsrv\w3wp.exe” line is not in the older log file. From what I can tell, this file and directory has permission for everyone to read/execute so I am not sure what file/folder the access is being denied for.
So my questions are:
- 1. What file/folder is WinSCP trying to access when setting the DebugLogPath that an access denied error could be produced? and what right are needed?
2. Is there a solution to this problem that is NOT “don’t create the log files” or “giving every user who uses this service Admin rights” ?
3. Is this is a bug within the latest version of WinSCP which is stopping non-admin users from setting/creating log files?
TIA