Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WScript.Arguments...I don't get it. 1

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I'm trying to write a simple script. One of the things I want to do is to get the command line arguments, which I've found the syntax for. However, I don't understand that when I see examples (in this forum and others) the syntax that's used is:

Dim oArgs
Set oArgs = WScript.Arguments

When I use this syntax, I get an error telling my that the WScript object has not been created. I've also seen syntax like this:

set Something = WScript.CreateObject(...)

But the only way I can make it work is like this:

Set Something = CreateObject(...)

I save my files as type .vbs

I don't understand.
 
The WScript object is the root object of the Windows Script Host (WSH) object model hierarchy.
Right click your VBS file and choose a program like cscript.exe or wscript.exe to run it.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Ok, that makes sense. About six months ago I did one of these (I'm a newbie with this stuff...seldom mess with it yet) and I knew it had something to do with cscript. Also, after receiving your message, discovered it my book.

Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top