Run and exec usage sharing for Wscript.Shell objects in VBScript _vbs

Source: Internet
Author: User
Tags pscp

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.