2

Tengo un vbscript generado que ya funciona que me trae la ip y el hostname de la pc en donde se ejecuta, pero ahora necesito agregarle también que me traiga el usuario con el que está logeado.

dim NIC1, Nic, StrIP, CompName

Set NIC1 =     GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")

For Each Nic in NIC1

    if Nic.IPEnabled then
        StrIP = Nic.IPAddress(0)

        Set WshNetwork = WScript.CreateObject("WScript.Network")
        CompName= WshNetwork.Computername

        MsgBox "IP:  "&StrIP & vbNewLine _
            & "Nombre del Equipo:  "&CompName,4160,"asdasd"

        wscript.quit

    End if
Next
1

1 respuesta 1

0

Con la instrucción

strUsuario = CreateObject("WScript.Network").UserName

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.