How to disable automatic symlink resolution from command line?

Advertisement

pokeefe
Joined:
Posts:
6
Location:
Pacific Northwest, USA

How to disable automatic symlink resolution from command line?

WinSCP fails when trying to copy Windows user profiles when it finds a symbolic link (or maybe it's a junction). The process fails with "(EDirectoryNotFoundException) The drive cannot be found" error and "File or folder 'C:\Users\All Users\Application Data' does not exist. ("The drive cannot be found")"

I found a reference to avoiding this during an interactive execution of WinSCP
https://winscp.net/eng/docs/ui_login_directories
but I cannot find how to do that in a batch execution.

Reply with quote

Advertisement

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

Re: How to disable automatic symlink resolution from command line?

That folder is special. Even Windows File Explorer hides it for some reason. And it cannot really be accessed. So use file mask to exclude it.

Note that the GUI option that you have found is for remote links, not local.

Reply with quote

pokeefe
Joined:
Posts:
6
Location:
Pacific Northwest, USA

Re: How to disable automatic symlink resolution from command line?

martin wrote:

That folder is special. Even Windows File Explorer hides it for some reason. And it cannot really be accessed. So use file mask to exclude it.

Note that the GUI option that you have found is for remote links, not local.
Actually, I'm trying to copy all of C:\Users and it looks there there are a number of such inaccessible links. So I have to find each one and exclude it ... and how that Windows doesn't create another while I'm not looking? Ugh! (Yes, the same set of masks should work for each user's profile, but kind of an ugly solution.)

Reply with quote

pokeefe
Joined:
Posts:
6
Location:
Pacific Northwest, USA

I had stopped working on this project for a while, but I'm back to it now.

Exclusion list is not really a feasible solution because I there are a lot of links in the AppData and I don't know when Windows might create another one. I assume that does not happen often, but I want this execution ti happen daily without my having to babysit it.

I think the only usual cause for my running into this "EDirectoryNotFoundException" error would be in the case of the symbolic links, and I would be perfectly happy to ignore the error and continue processing. Is there such an option? I haven't found it, but I think it's been asked for in the past. Judging from the WinSCP log, in interactive mode I would have been asked what to do so it seems like I should be able to set a default action option.

Reply with quote

Advertisement

pokeefe

I didn't know about that option and haven't been able to find it other than by using the link you provided. And I'm beginning to realize the term "scripting" in WinSCP does not just mean running WinSCP from a .bat or .ps1 script. If WinSCP scripting is a way of putting WinSCP commands, switches, and options in a file I will definitely look into it.

Reply with quote

Advertisement

You can post new topics in this forum