|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Super easy question of the day
So I know pretty close to zero about vb scripting just to give you some background ^_^
Okay I found this code in another post on this forum and it does exactly what I need it to except it echos the information instead of writing a line (for me this is going into a hta file). I was hoping you guys could help me out with the right syntax. I'm guessing it needs to use this .write thing I keep seeing but trying to guess at the syntax is producing all kinds of wacky errors. Any help is much appriecated. Code:
<SCRIPT LANGUAGE="VBScript">
Option Explicit
Dim WSHShell
Dim objNTInfo
Dim GetComputerName
Set objNTInfo = CreateObject("WinNTSystemInfo")
GetComputerName = lcase(objNTInfo.ComputerName)
</SCRIPT>
|
|
#2
|
||||
|
||||
|
--moved to the Windows Scripting forum, although it might fit more in the HTML forum
since it's client side vbscript used as part of website. anyway, in the code you posted there is nothing that echo anything. whatever code that cause it is elsewhere. |
|
#3
|
|||
|
|||
|
Here is the original code taken from the other thread
Code:
Option Explicit
Dim WSHShell
Dim objNTInfo
Dim GetComputerName
Set objNTInfo = CreateObject("WinNTSystemInfo")
GetComputerName = lcase(objNTInfo.ComputerName)
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Popup(GetComputerName)
WScript.Quit
|
|
#4
|
||||
|
||||
|
That script gets the local machine and returns it in a basic message box.
It's seems to me that you want to write it into an HTML page. All you need do to is change write the variable back. Don't forget to include any html formatting...here's an example. Code:
<script language="vbscript">
Option Explicit
Dim WSHShell
Dim objNTInfo
Dim GetComputerName
Set objNTInfo = CreateObject("WinNTSystemInfo")
GetComputerName = lcase(objNTInfo.ComputerName)
Document.Write "<p>The computer name is <b>" & GetComputerName & "</b></p>"
</script>
The computer name is computername You might want to take a look at Microsoft's HTML Application Reference.
__________________
Click the image if at any point you don't like my decision.Scripting problems? Windows questions? Ask the Windows Guru! |
![]() |
| Viewing: ASP Free Forums > System Administration > Windows Scripting > Super easy question of the day |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|