Thanks Martin,
That takes care of the enum values. But I am still having issues with just WinSCP syntax for VB Scripting.
I want to set file permissions for the Put Files method and constructing the syntax seems to still be challenging.
I end up doing a lot of trial and error. I need to set the file permissions to
0777
octal. I have tried these combinations.
transferOptions.FilePermissions.Octal( "0777")
transferOptions.FilePermissions.Octal = "0777"
transferOptions.FilePermissions.FilePermissions.Octal( "0777")
transferOptions.FilePermissions.FilePermissions.Octal = "0777"
transferOptions.FilePermissions_FilePermissions.Octal( "0777")
transferOptions.FilePermissions_FilePermissions.Octal = "0777"
VBScript runtime error: Object required: '[object]'
In the
TransferOptions.cs
file here is the definition of
FilePermissions
:
public sealed class TransferOptions
{
public bool PreserveTimestamp { get; set; }
public FilePermissions FilePermissions { get; set; }
...
}
When you provide the syntax, please let me know what steps you took to determine the syntax. With VB Scripting, you don't have any IntelliSense to help construct proper syntax. Even if you find out via IntelliSense in VB.NET it may not translate directly to VB script. That is what prompted my first question with Enums. Hindsight I would have probably taken a closer look at PowerShell. But most of the file transfers we do can be done with the basic VB Script example. Just run across these one-offs that require setting file permissions, for example
Again Martin, thanks so much for your help.