Fixing WinSCP editor error
I have been a heavy user of WinSCP for quite a few years. It is a great tool whether you need to connect to FTP, SFTP or even WebDAV servers. WinSCP offers an integration with code editors so that you can open the remote file and edit it with your local editor. Since April, I started hitting a weird issue which prevented me from using this feature correctly.
For a while WinSCP has been offering an option to be installed via Microsoft Store which is really awesome - automated background updates!
Basically the application has been converted into MSIX package and distributed through Microsoft Store. I have been using the editor feature for few months successfuly but suddenly, I started seeing following errors:
System Error. Code: 1392. The file or directory is corrupted and unreadable
During that, the only workaround was to launch it via shortcut ( C:\Users\hajek\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd) through command-line which worked, but I sometimes ended up with multiple command-line windows open.
Since I don't really edit code this way anymore, rather server configuration from time to time or use it for file transfer only, I didn't pay much attention.
Today, I decided to figure out what was going on. After reading some stuff about how File System operations work in packaged apps, I reallized that the issue must there.
So I browsed through the app's filesystem which is located at: C:\Users\%USERNAME%\AppData\Local\Packages\MartinPikryl.WinSCP_tvv458r3h9r5m\ and found what I was looking for!
The Code.exe file was present there (in LocalCache\Local\Programs\Microsoft VS Code) in some weird corrupt state. I simply went and deleted the VS Code folder and everything started to work like before!
Comments
Jamala
For me error isn’t corrupted, it is ‘cannot remove temporary directory’ ..After I open files,with visual code next to file name written deleted. (login.php (deleted) ) . And I check winscp file is there but this error appear..
To submit comments, go to GitHub Discussions.