|
-
Aug 2nd, 2006, 07:47 AM
#1
Thread Starter
New Member
[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?
-
Aug 2nd, 2006, 08:02 AM
#2
Re: Need Newline Code
In vbScript I think vbCrLf will work...
-
Aug 2nd, 2006, 08:37 AM
#3
Thread Starter
New Member
Re: Need Newline Code
That worked SevenHalo. Thanks for the help.
-
Aug 2nd, 2006, 08:40 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|