Set exeRs = ("pscp -r -scp -pw " & password & " " & loginid & "@" & host & ":" & data_path & fileName & " " & windows_path)
But intestofhourWait, as a copycowryFile comparisonComparativeBig, collideLong timeofhourWait for a whilenowcmdThe window is dead theremoveIf the situation is gone, it is directlycmdRun in the windowpscpCopycowryThe same file will work fineKnotbundle. Can't find what it isIs itThe reason was changed torunmethodtryone time,KnotfruitrunThe method is OKKnotBut the original generationcodeNeed to obtaincmdThe consoleloseandrunHowever, it is not convenient to obtain console information. In the end, you can only redirect the console information to the file first, and then the program willreadPick. at lastexplainone timerightrunandexecThe two methods of the zoneDon'tSome understandings of:
thisThe declaration of the two methods is as follows
Function Exec(ByVal Command As String) As WshExec
Function Run(ByVal Command As String, [ByVal WindowStyle], [ByVal WaitOnReturn]) As Integer
You can see the areaDon't:
1,runReturnvalueIt's an integer, that's0or1Success and lossdefeatTwo shapesstate,andexecReturn of methodvalueIt's onerightElephant, return fromrightIt canGetHave a consoleloseOutput information and consolemistakeInformation, i.e.StdOutandStdErrAttributes, etc. For example:
Set exeRs = ("pscp -r -scp -pw 。。。。"
errMsg = ()
stdMsg = ()
You can access the consolemistakeand console information.
2,Run The last two parameters arecmdWindow'swindOne is whether to waitPersistenceThe line is finished. The last parameter is useful if you wish to wait for this timecmdPersistenceThe program that is in progressKnotAfter thePersistenceOK The one behindlanguageSentencetalk,if onlyset upSetthisParametersfortrueThat's fine, nobutThe one behindlanguageThe sentence will not waitcmdThe window is completed and run directly (our project has this requirement. After copying a file from the server and going to the local area, you need to open the file operation immediately. If the file is not copied, you will have an error.). Also, if you useexec MethodhourWait, if you want to waitcmdIn-process programPersistenceAfter thePersistenceThe one behindlanguageThe sentence can also be readPassThe following method:
()or(), reasonshouldIt's easy to understand, you need to get itloseThe information must be sentcmdPersistenceThere will be no more after theloseOut.
ParametersdetailedInformation can be referencedmsdn
/zh-cn/library/ateytk4a(en-us,VS.85).aspx
/zh-cn/library/d5fk67ky(en-us,VS.85).aspx