Make my vbscript look more professional

MyScript.vbsHi All,

New here and new to scripting. I have made myself a script to send me an email with user and computer details of whoever runs it.

The script works but I would like to make it look a bit more professional (maybe in a table) I tried looking into HTML but couldn't get my head around doing that (or if its possible)

Anyways here is my script. If you see anything wrong please let me know as I am new to this.

Many Thanks

Lance
Lance DavidsonAsked:
Who is Participating?
 
NorieVBA ExpertCommented:
Lance

How about something like this?
objMessage.HTMLBody = "<table border=1>" & _
                      "<tr><th colspan=2>Logged on user is " & UserName & " using Computer " & ComputerName & "</th></tr>" & _
                      "<tr><td>Serial Number </td><td>" & strSerialNumber & "</td></tr>" & _
                      "<tr><td>Current </td><td>" & strIP & "</td></tr>" & _
                      "<tr><td>Disk Info </td><td>" & sDisk & "</td></tr>" & _
                      "<tr><td>Manufacturer </td><td>" & strManufacturer & "</td></tr>" & _
                      "<tr><td>Model </td><td>" & strModel & "</td></tr>" & _
                      "<tr><td>OS </td><td>" & strOsversion & strSp & "</td></tr>" & _
                      "</table>"

Open in new window


That would replace this in your posted code.
objMessage.TextBody = "Logged on user is " & userName & " using Computer " & ComputerName & " | Serial Number " & strSerialNumber & " | Current " & strIP & " | Disk Info " & sDisk & " | Manufacturer = " & strManufacturer & " | Model = " & strModel & " | OS = " & strOsversion & strSp

Open in new window

1
 
NorieVBA ExpertCommented:
Lance

Do you mean make the body email sent by the script look more professional?
0
 
Lance DavidsonAuthor Commented:
Yes, sorry I was in a rush writing this post.

Even if I could get it to look like
User: lance
Computer: pc9999
IP Address: 8.8.8.8
Would help but if we could make it even more fancy I’d be happy to take suggestions.
0
 
Lance DavidsonAuthor Commented:
You my friend are a legend. That's what I was after.

Thank you

Also would you say this is that best script to use for this sort of thing or would you use something different?  Would like to know how other people would script something like this.

Cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.