Set exers = objWS. Exec ("Pscp-r-scp-pw" & Password & "" & loginID & "@" & Host & ":" & Data_path & Filen Ame & "" & Windows_path)
But inTestOfWhenWait, be handcuffed.BayesianThe file thanMoreBig, cuff.Longer shell timeOfWhenWait on theIsCmdWindow dead in there notMoveThe situation, directly in theCmdRun in WindowsPscpCopyBayesianThe same file can be normal knot bunch. Also can not find is what run method run code cmd run read said runexec two methods
The statements of these two methods are 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 a few areas :
The return of the
1,run value 01 success and loss of Two-shaped exec value The span lang= "ZH-CN", from the return stderr attributes etc. Example:
Set exers = objWS. Exec ("Pscp-r-scp-pw .....) "
ErrMsg = ExeRs.StdErr.ReadAll ()
Stdmsg = OExec.StdOut.ReadAll()
you can go via console error and console information.
2,RunThe latter two parameters, one isCmdof the windowWindLattice, one is whether to waitPracticeLine complete. The last parameter is useful if you want to wait for this timeCmdPracticeLines of the programKnotBundle upon thePracticeYesobjWS. Exec set this true cmd windows complete, run directly (our project has this requirement, copy a file from the server to the local, To open this file immediately, if the file does not copy the end of the operation will be wrong. )。 In addition, if you use the exec cmd
OExec.StdErr.ReadAll () or oExec.StdOut.ReadAll(), the reason should also be good understanding, to get the information to be lost , must be cmd after the completion of the practice will have to lose.
The details of the parameter can be referred to the MSDN
HTTP://MSDN.MICROSOFT.COM/ZH-CN/LIBRARY/ATEYTK4A (en-us,vs.85). aspx
Http://msdn.microsoft.com/zh-cn/library/d5fk67ky (en-us,vs.85). aspx