No, I do not have any idea.
- martin
I see this thread was never finalized, so for what it is worth:
I get that same Windows prompt (to install .NET 3.5) on my clean WIN10 install, the first time I want to use the .NET assembly.
Andre
<job>
<reference object="WinSCP.Session"/>
<script language="VBScript">
Option Explicit
' Check and read input arguments
Dim numArgs
numArgs = WScript.Arguments.Count
If numArgs < 2 Then
WScript.Echo "Usage: /DINI:<Now> /DFIN:<Now> /R_PATH:<remote-path> /L_PATH:<local-path>"
WScript.Quit ( 1 )
End If
Dim valArgs
Set valArgs = WScript.Arguments.Named
If Not ( valArgs.Exists( "R_PATH" ) ) And Not ( valArgs.Exists( "L_PATH" ) ) Then
WScript.Echo "Usage: /DINI:<Now> /DFIN:<Now> /R_PATH:<remote-path> /L_PATH:<local-path>"
WScript.Quit ( 2 )
End If
Dim vRemotePath, vLocalePath,vHost,vUser,vPsw
vRemotePath = valArgs.Item( "R_PATH" )
vLocalePath = valArgs.Item( "L_PATH" )
vHost=valArgs.Item( "Host" )
vUser=valArgs.Item( "User" )
vPsw=valArgs.Item( "Psw" )
Dim oFSO
Set oFSO = CreateObject( "Scripting.FileSystemObject" )
If Not oFSO.FolderExists( vLocalePath ) Then
set oFSO = Nothing
WScript.Echo "L_PATH does not exists!!!"
WScript.Quit ( 3 )
End If
set oFSO = Nothing
Dim vDINI, vDFIN
If valArgs.Exists( "DINI" ) Then
vDINI = cDate(valArgs.Item( "DINI" ))
If Not isDate(vDINI) Then
WScript.Echo "DINI non è una data!!!"
WScript.Quit ( 4 )
End If
End If
If valArgs.Exists( "DFIN" ) Then
vDFIN =cDate(valArgs.Item( "DFIN" ))
If Not isDate(vDFIN) Then
WScript.Echo "DFIN non è una data!!!"
WScript.Quit ( 5 )
End If
End If
If Not valArgs.Exists("Host") Then
WScript.Echo "Manca l'host"
WScript.Quit ( 6 )
End If
If Not valArgs.Exists("User") Then
WScript.Echo "Manca l'user"
WScript.Quit ( 7 )
End If
If Not valArgs.Exists("Psw") Then
WScript.Echo "Manca la password"
WScript.Quit ( 8 )
End If
Set valArgs = Nothing
' Setup session options
Dim sessionOpts
Set sessionOpts = WScript.CreateObject( "WinSCP.SessionOptions" )
With sessionOpts
.Protocol = Protocol_Ftp
.HostName = vHost
.UserName = vUser
.Password = vPsw
End With
Dim session
Set session = WScript.CreateObject( "WinSCP.Session" )
' Connect
session.Open sessionOpts
Set sessionOpts = Nothing
Dim dirInfo
Set dirInfo = session.ListDirectory( vRemotePath )
Dim remoteFile, localeFile, fileInfo
For Each fileInfo In dirInfo.Files
If fileInfo.LastWriteTime >= vDINI and fileInfo.LastWriteTime <= vDFIN Then
remoteFile = vRemotePath + fileInfo.Name
localeFile = vLocalePath + fileInfo.Name
session.GetFiles( remoteFile, localeFile ).Check( )
WScript.Echo remoteFile
End If
Next
Set dirInfo = Nothing
'Disconnect and clean up
session.Dispose
Set session = Nothing
WScript.Quit( 0 )
</script>
</job>