2

I am a newbie in the programming. I am wondering what the difference is between below two method of kicking off a VBScript. Both of them work on my machine.

call "C:\script.vbs"

cscript "C:\script.vbs"

1 Answer 1

2

Usually, people compare cscript with wscript, the difference is explained here:

Difference between wscript and cscript

"Call" calls one batch program from another without stopping the parent batch program.

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/call.mspx?mfr=true

CALL command vs. START with /WAIT option

In Windows, if you are running an automated program written in several batch scripts, you'll want to use "call".

Sign up to request clarification or add additional context in comments.

4 Comments

I understand both pairs, wscript/cscript and call/start; but my question is whether there is a different between call script.vbs and cscript script.vbs
@lovechillcool OK, if so, based on my knowledge, if there is a message box in your vbs (e.g.: wscript.echo("OK")), using call will show a windows message box, using cscript will show the message in the parent console.
It should be noted that this is basically because call will use the default scripting host which is wscript not because call does that. call on something different than a batch is more or less the same as not using call
And also, if use cscript, ugly header would show up so I used cscript //nologo to suppress it; call doesn't show the header in the first place.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.