Results 1 to 4 of 4

Thread: [RESOLVED] Need Newline Code

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    3

    Resolved [RESOLVED] Need Newline Code

    I have written a script that shows user name, computer ID, and Dell Service Tag. When I output the info using Wscript.echo it will output each of the three listed above in individual messageboxes. I change the code so it outputs to one message box but i cant get the output to go to a newline. It displays all on the same line. Here is my code.

    ' VBScript source code
    Option Explicit
    Dim objWshShell, colitems, objWMIservice, objitem, strUserName, strComputerName
    Set objWshShell = CreateObject("WScript.Shell")
    strUserName = objWshShell.ExpandEnvironmentStrings("%USERNAME%") ' Locates Username
    strComputerName = objWshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") ' Locates Computer Name
    Set objWMIservice = GetObject("winmgmts:\\.\root\cimv2")
    set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48)
    For each objitem in colitems ' Locates Dell Service Tag
    Wscript.echo " User Name: " + strUserName & " Computer Name: " + strComputerName &_
    " Dell Service Tag: " & objitem.serialnumber ' Displays
    Next



    What is the code to make the output UserName ***** then have Computer name go to the Newline?

  2. #2
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Need Newline Code

    In vbScript I think vbCrLf will work...

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    3

    Re: Need Newline Code

    That worked SevenHalo. Thanks for the help.

  4. #4
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Need Newline Code

    No prob. Don't forget to resolve your thread under thread tools.

    Also, for future reference; make sure you post in the right forum. The following link points at our VBScript section:
    http://www.vbforums.com/forumdisplay.php?f=4

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