Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file beca

Advertisement

bagdrums
Joined:
Posts:
6
Location:
uk

Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file beca

Hi Support
I noticed a similar Support Post under this web page url below:-
WinSCP.ini file in use
The error message in this earlier post was slightly different from mine as it refers to
Cannot "Create file" rather than Cannot "Open File" System Error. Code: 32.

My Question is - does the advice to Set the INI file read-only also apply the the error message that I am receiving below:-
Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file because it is being used by another process
Is there a way to see what process had the WinSCP.ini file locked

Many Thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file beca

Can you provide some context? Under what circumstances do you get the error?

Reply with quote

bagdrums
Joined:
Posts:
6
Location:
uk

Re: Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file beca

Hi
I have a number of Windows Task scheduled WinSCP scripts running from a Windows 2019 SFTP server. (The scripts are Windows commands batch files)

I think what must have happened is that a couple of tasks/scripts have overlapped due to retry attempts. The scripts I have piped to log files and it is these log files that display the error message:
Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file because it is being used by another process.
I realise I can amend the Windows Task scheduling to help avoid this happening, but I also wanted to know if making the WinSCP.ini Read only may also be a way to avoid any future contention for the WinSCP.ini file.
Many Thanks

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file beca

It's possible that another instance was just writing the INI file, what prevented the erroring instance to open/read it.

Setting the INI file read-only should help in this scenario.
https://winscp.net/eng/docs/config#ini_readonly

Though in general, we recommend not to rely on configuration (INI file):
https://winscp.net/eng/docs/scripting#different_account

Reply with quote

bagdrums
Joined:
Posts:
6
Location:
uk

Re: Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file beca

Hi
Thanks for the reply.
I thought that the WinSCP.ini was predefined and fixed config file, so I'd understand a process needing to open the file but why would a process need to write to an .ini config
file?
Thanks again for the advice.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Cannot open file "C:\Program Files (x86)\WinSCP\WinSCP.ini". The process cannot access the file beca

The INI file does not contain configuration only.
It contains caches and usage statistics too.

Reply with quote

Advertisement

You can post new topics in this forum