Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    PA
    Posts
    246
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBScript reference

    Been trying to use VBScript in connection with the Windows Scripting Host as a batch language. Little vbs files that do things little things for you locally (not as a web language). Here's a useful example that I use to maintian a listserv that I moderate. It opens the local text files containing the addresses, and loads the list maintanence page in my browser. You can modify it to open certain reports in word and spreadsheets in excel that you use together:
    <pre>Set objShell = CreateObject("WScript.Shell")
    Set objFSO = CreateObject("Scripting.FileSystemObject")

    RunFile "E:htmlIN_PROGardceGroups_ardc_committee_Members.U RL"
    RunFile "E:htmlIN_PROGardccommittee.email-only.txt"
    RunFile "E:htmlIN_PROGardccommittee.list.txt"
    RunFile "E:htmlIN_PROGardcdemocrats.email-only.txt"
    RunFile "E:htmlIN_PROGardcdemocrats.list.txt"

    Set objShell = Nothing
    Set objFSO = Nothing

    Sub RunFile(strFile)
    If objFSO.FileExists(strFile) Then
    objShell.Run Chr(34) & strFile & Chr(34)
    Else
    objShell.Popup Chr(39) & objFSO.GetFileName(strFile) & _
    Chr(39) & vbCr & "could not be found!", 3, _
    "Maintenance Session Error", 48
    End If
    End Sub</pre>


    I've tried to leverage my knowledge of VBA, but a lot of the syntax is different. Is there a VBS help file or a downloadable quick reference?

  2. #2
    navir
    Guest

    Re: VBScript reference

    Hi, Art:

    Search your hard disk for vbscrib5.chm. It's a VBScript reference help file installed with Visual Studio, and other MS programs.

    Go to:

    http://msdn.microsoft.com/scripting/

    for additional information on Microsoft scripting technologies.

    Finally, take a look a books like O'Reilly's "Learning VBScript", or Wrox's "VBScripot Programmer's Reference".

    Good luck. Let us know what's best in your opinion.

    Regards,
    Ivan

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBScript reference

    There's also VBScript in a Nutshell by Paul Lomax published by O'Reilly.

    I'm recently reading a book published by Wrox about the WSH that goes into great detail about the capabilities of the WSH.

    I've been able to do some neat things using WSH & VBScript.

    Mike

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: VBScript reference

    Okay, I like Lomax's nutshells on VBA and VBScript, but I find it sad that typos in the VB&VBA (1998) were not corrected in the VBS (2000). Example: the reference to the Filter function in the discussion of using Split; sloppy copy/paste/edit. Still, compared with the official doc, the books are a godsend.

Posting Permissions

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