Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question 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
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy 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.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •