Questions

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

+
1 Votes
Locked

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

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
+
1 Votes
seanferd

I don't do code, really, but I see nothing that directs the script to any particular machine. You can't just pull a directory from thin air.

Further, you would need permissions to run on the machine. So, if you can't browse the network and pull up this user directory, the script won't either.

Hope someone with further scripting knowledge can give you something more specific.