Web Analytics Made Easy -
StatCounter wsh: createing objects that already exist.. - CodingForum

Announcement

Collapse
No announcement yet.

wsh: createing objects that already exist..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • wsh: createing objects that already exist..

    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?

  • #2
    The CreateObject call creates an "instance" of the object, not the object itself.
    Check out the Forum Search. It's the short path to getting great results from this forum.

    Comment


    • #3
      need a boost with creating folders in wsh

      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.

      Comment


      • #4
        It takes three lines but:

        Code:
        Set fso = CreateObject("Scripting.FileSystemObject")
        fso.CreateFolder ".\new folder"
        Set fso = nothing
        Check out the Forum Search. It's the short path to getting great results from this forum.

        Comment


        • #5
          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:

          wscript.connect("http://www.google.com")

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

          Comment


          • #6
            Use the Run method of the Shell object:

            http://msdn.microsoft.com/library/de...properties.asp

            Put the URL in place of the program name and then it'll start the user's default browser opening the indicated page.
            Check out the Forum Search. It's the short path to getting great results from this forum.

            Comment

            Working...
            X