View Full Version : wsh: createing objects that already exist..

02-19-2004, 05:30 PM
I dont understand this line of vbs code for wsh.

Set fso = CreateObject("Scripting.FileSystemObject")

the filesystemobject already exist, so why do you need to put the "createobject" thing there?

Roy Sinclair
02-19-2004, 06:09 PM
The CreateObject call creates an "instance" of the object, not the object itself.

02-19-2004, 06:58 PM
could someone just give me one line of code to help me create a folder in wsh..
I know what the filesystemobject is one of the things i need, but i need some help on the rest of it, any help that anyone could give me is very welcome.

Roy Sinclair
02-19-2004, 07:37 PM
It takes three lines but:

Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateFolder ".\new folder"
Set fso = nothing

02-19-2004, 08:43 PM
Thank you Roy, if you dont mind I got another question

I am making a script that asks the user if they want to connect to google.com.. if the user says "yes" then this string is susposed to connect them:


is that even possible in wsh or do i need some other program to do that?

Roy Sinclair
02-19-2004, 09:34 PM
Use the Run method of the Shell object:


Put the URL in place of the program name and then it'll start the user's default browser opening the indicated page.