VB调用pscp和psftp
471次浏览
编辑于2017年03月10日 09:45:03
请问有老师在vb调用过psftp程序吗?
客户用的是SFTP, 我通过pscp完成了文件上传下载功能, 但是需要下载完成后删除源文件, pscp好像没有删除方法所以想通过psftp来完成, 可是具体语法不知道怎么写, 请各位老师指教一下, 谢谢
Const cstrSftp As String = "E:\pscp.exe"
Dim strCommand As String
Dim pUser As String
Dim pPass As String
Dim pHost As String
Dim pFile As String
Dim pRemotePath As String
'上传
strCommand = cstrSftp & " -sftp -l " & pUser & " -pw " & pPass & _
" " & pFile & " " & pHost & ":" & pRemotePath
Debug.Print strCommand
Shell strCommand, 0 '