سلام دوستان فرمان در وبندوز جهت غیر فعال کردن کارت شبکه یا همان disable کردن
کارت شبکه چگونه امکان پذیر است با تشکر
Printable View
سلام دوستان فرمان در وبندوز جهت غیر فعال کردن کارت شبکه یا همان disable کردن
کارت شبکه چگونه امکان پذیر است با تشکر
[B]netsh interface set interface name=“Local Area Connection” admin=DISABLED
البته این تو ویندوز ۲۰۰۳ کار میکنه
[/B]
[url=http://support.microsoft.com/kb/q311272/]The DevCon command-line utility functions as an alternative to Device Manager[/url]
برای ویندوزxp هم از این ابزار استفاده کنید
با netsh نمی*شه مثل اینکه کاری رو که می*خواهید انجام داد
البته میتونین این دستور رو هم بزنین ipconfig /release ولی* خوب این دستور کارت شبکه رو غیر فعال نمیکنه و فقط ip رو آزاد میکنه
ممنون دوست عزیز حالا اگه بخوام از راه دور کارت شبکه رو برای یه لحظه غیر فعال و دوباره فعال کنم آبا فرمانی برای اون هست ممنون
باید تاپیک بالا رو بخونی* ، با اون می*شه این کار رو کرد دوست گرامی*
[LEFT]' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' Disable Wireless Network Cards ( => MediaSubType=2 )
' note,
' You can not run this script as user Logon-script - unless
' the current user is a member of the local group Administrators.
' Therefore it is better you run this script as computer Startup-script.
'
' you can store Devcon.exe on a networkshare,
' in that case, replace the line with:
' oWShell.Run """\\server\share\devcon.exe"" disable ""@" & strValue & """" ,2,true
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
Const HKEY_LOCAL_MACHINE = &H80000002
Public oWShell, oReg
strComputer = "."
Set oWShell = Wscript.CreateObject("Wscript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = _
"SYSTEM\CurrentControlSet\Control\Network"
EnumeratingSubkeys HKEY_LOCAL_MACHINE, strKeyPath
Wscript.quit
Sub EnumeratingSubkeys(HKEY_LOCAL_MACHINE, strKeyPath)
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
If IsArray(arrSubkeys) Then
For Each strSubkey In arrSubkeys
If Instr(subkey, "{4D36E972") = 0 Then
EnumeratingSubkeys HKEY_LOCAL_MACHINE,_
strKeyPath & "\" & strSubkey
End If
If subkey <> "Descriptions" Then
strValueName = "MediaSubType"
oReg.GetDWORDValue HKEY_LOCAL_MACHINE,_
strKeyPath & "\" & subkey & "\" & "Connection" ,_
strValueName,dwvalue
If dwvalue = 2 Then
strValueName = "PnpInstanceID"
oReg.GetStringValue HKEY_LOCAL_MACHINE,_
strKeyPath & "\" & subkey & "\" & "Connection" ,_
strValueName,strValue
oWShell.Run "devcon.exe disable ""@" & strValue & """" ,2,true
End If
End If
Next
End If
End Sub
\Rems
EDIT
note!
If you add the name of a remote computer for "strComputer", the script will EnumeratingSubkeys on the remote computer...
BUT - devcon.exe however will be executed by this script on your local computer!!!!!!!!! and not on the remote computer.
[/LEFT]
متشکرم استاد عزیز خیلی مفید بود
[QUOTE=katsi_ppp;221033]ممنون دوست عزیز حالا اگه بخوام از راه دور کارت شبکه رو برای یه لحظه غیر فعال و دوباره فعال کنم آبا فرمانی برای اون هست ممنون[/QUOTE]
بله میشه!
اتفاقا برای من بسیار مفید واقع شده! من شخصا دنبال همچین امکانی میگشتم تا 3 ماه پیش که راهش رو پیدا کردم!
شما یه فایل text باز کنید و در آن دو خط زیر را بزنید:
[B]netsh interface set interface “Local Area Connection” DISABLED
[/B][B]netsh interface set interface “Local Area Connection” ENABLED[/B]
سپس پسوند فایل را عوض کنید و از txt به bat تغییر دهید!
tada!
حالا شما با دابل کلیک به نتیجه دلخواه میرسید.
امیدوارم براتون مفید واقع شده باشه