How can this code be translated to VBScript??

sparx

Morphed Human
Local time
Today, 13:31
Joined
Jul 22, 2002
Messages
80
I have this little bit of code which I extracted from VBA. I need to convert it to a script. The VBA function 'WGetComputer' is not available in VBScript. What this code does is it simply returns the name of the current computer.

Dim lngLength
Dim lngActual
Dim strComputer

lngLength = 16
strComputer = String(lngLength, 0)
lngActual = WGetComputer(strComputer, lngLength)

GetComputerName = Nz(Left(strComputer, lngLength), "Unknown")
MsgBox GetComputerName

Thanks for all your help,

Erik
 
As far as i know there is no native VBA function called WGetComputer....

But that might just be me....

Regards
 
It's missing the API Declaration.
 
Does Environ("username") work with VBScript?
 

Users who are viewing this thread

Back
Top Bottom