Results 1 to 4 of 4

Thread: VB-script [resolved]

  1. #1

    Thread Starter
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872

    Unhappy VB-script [resolved]

    Whitch type of project do you need to start to create a VBS-file?
    Last edited by robbedaya; Sep 7th, 2003 at 03:47 AM.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    You can use Notepad! Just start a new doc up, enter this:
    VB Code:
    1. Msgbox "Hello World !"
    & save it as test.vbs. When you double click it, you'll see the code excecutes & you get the message pop up on your screen.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872
    great!! thanks

  4. #4
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    If you want some more help for VB Script, this had some at some stage: http://www.vb-island.com/vbscript.php3

    Or else, try these examples:
    For example:
    Set ww = Wscript.CreateObject(“Word.Document”)
    ww.Application.DefaultSaveFormat = “”
    MsgBox “Word 97 is now saving in its default format”


    Send a message using Outlook:
    set outL=WScript.CreateObject("Outlook.Application")
    set mapi=outL.GetNameSpace("MAPI")
    set email=outL.CreateItem(0)
    email.Recipients.Add("[email protected]")
    email.Subject = "Test"
    email.Body = "Test"
    email.Send
    Set outL=Nothing
    Set mapi=Nothing

    List files in a folder:
    set fso = wscript.createobject("Scripting.FileSystemObject")
    set folder=fso.getFolder("C:\Temp")
    i=1
    For Each file In folder.Files
    msgbox(i & ". " & file.name & vbcrlf)
    i=i+1
    next

    Shell out to another application:
    Dim wShell
    Set wShell = WScript.CreateObject("WScript.Shell")
    wShell.Run "notepad", 2
    Set wShell = Nothing

Posting Permissions

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



Click Here to Expand Forum to Full Width