0

I know that you can use something like:

$variable = "value 1"

cscript test.vbs $variable

but how exactly do you capture that variable inside the vbs script? Thanks.

4
  • You should provide examples to what you've already tried to do in your vbs script Commented Dec 13, 2012 at 12:54
  • @pabrantes - what's the use of asking a person admittedly not knowing how to do X to give examples of failed attempts to do X? Commented Dec 13, 2012 at 13:06
  • 1
    @Ekkehard.Horner: my comment was done having in mind the information in Do your homework from stackoverflow.com/questions/how-to-ask I think it's fine for people not knowing things (nobody knows everything) but I don't think the idea is for SO to be Google, hence, showing a little research / code tries wouldn't hurt. But I'm new here, so I might be wrong, do you think it was overreacting from my part? Commented Dec 13, 2012 at 13:16
  • @pabrantes - I'm all for encouraging people to 'do their homework' before they ask, but in this case (and in many others), asking for code makes no sense. Commented Dec 13, 2012 at 14:00

2 Answers 2

1

By accessing the WScript.Arguments collection. HowTo

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

Comments

0

WScript.Arguments is a good way to go. Another option is to use a WSF file to put a bit more structure around your script.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.