Question

  • Creator
    Topic
  • #2172828

    How can I disable the NIC of another pc using vbscript from my pc?

    Locked

    by ajrob2 ·

    i have here a vbscript code that disables a NIC and i designed it to work with windows 7.
    ——————————————————————————————————————————-
    ‘disable.vbs

    CONST CSIDL_CONNECTIONS = 49

    set shellApp = CreateObject(“Shell.Application”)
    set oNetCon = shellApp.Namespace(CSIDL_CONNECTIONS)

    sLocalAreaConnection = “Local Area Connection”

    set oLanCon = nothing

    for each FolderItem in oNetCon.Items
    if FolderItem.Name = sLocalAreaConnection then
    set oLanCon = FolderItem
    end if
    next

    for each verb in oLanCon.verbs
    if verb.name = “En&able” then
    verb.DoIt
    end if

    if verb.name = “Disa&ble” then
    verb.DoIt
    end if
    next

    wscript.sleep 1000
    ——————————————————————————————————————————-
    I also have another vbscript to run ‘disable.vbs’ on another pc but it gives me an error message.
    ——————————————————————————————————————————-
    ‘send_disableScript.vbs

    set oController = CreateObject(“WSHController”)
    set oProcess = oController.CreateScript(“C:\Users\Blue_Rabbit\Desktop\disable.vbs”, “\\BLUE_RABBIT_PC\Users\Blue_Rabbit\Desktop”)
    oProcess.Execute
    While oProcess.Status <> 2
    WScript.Sleep 100
    WEnd
    ——————————————————————————————————————————-
    Running ‘send_disableScript.vbs’ gives me the error message:

    Error: The remote server machine does not exist or is unavailable
    Code: 800A01CE

All Answers

  • Author
    Replies
Viewing 1 reply thread