查看完整版本: 实用的问题--急急!!!

探月一号 2008-1-17 12:24

实用的问题--急急!!!

求解:公司用了一个无线路由器,可以连接30个用户左右,但是每次用户启动电脑的时候,无线就自动的连上了,导致需要无线的用户有时候连不上去(用户大于30),或很久才能连上无线,用户抱怨无线有问题。所以请问各位是否有什么命令(脚本或批处理)可以设置每次电脑启动时就把无线网卡Disabled,等需要使用的时候就Enabled。

gzbuzou 2008-1-18 03:39

米有用过无线的,都是用网线的:(

铁牛阳光 2008-1-18 14:41

这个问题要看怎么考虑了.
B;~.L"E8TPLEQ 有线网卡的人也需要使用无线吗?
Q Q+\*]:gC V9_6z,X m0OO:KpT)M
电脑如何区分是不是该用无线了?

Batcher 2008-1-21 15:36

2003系统可以用这个命令:D'U'{$`'H_/f.f
netsh interface set interface name="Wireless Network Connection" admin=DISABLED%h/Y W$`.d*M
a(jxuvda'yE3Bl
2000/XP系统需要使用VBS

Batcher 2008-1-21 15:37

可以参照这段代码改改:[code]Const ssfCONTROLS = 3  W!f@Y[;KB&z
sConnectionName = "本地连接"  '可改成需要控制的连接名称,如"无线网络连接"等  
(lg S(d)l ^*fXr sEnableVerb = "启用(&A)"  
3k `ux L2NTy:WY sDisableVerb = "停用(&B)"    非xp 系统可能 是禁用%n'\P0~ODp
set shellApp = createobject("shell.application")  
9^$c:xcCJ$i-G set oControlPanel = shellApp.Namespace(ssfCONTROLS)  
_Xa+o]8}:b \ set oNetConnections = nothing  
q~ ` N^ x&@ I8n4J for each folderitem in oControlPanel.items  
(i!R"Ju6N[7Ka @ if folderitem.name  = "网络连接" then  
`xW"_0J2X&?    set oNetConnections = folderitem.getfolder: exit for  
i t:PWMH H @*Tx end if  P},ls9@$?
next  
z JU6Y%f%FhE if oNetConnections is nothing then  
,KA;udg(i+z@ msgbox "未找到网络连接文件夹"  *} ga-o^l H+{/m
wscript.quit  
(LF'f9\q4` end if  
8KgE7[^N set oLanConnection = nothing  *S+`Ne`~$l&A
for each folderitem in oNetConnections.items  z~ ]0Sz2e2x#`v
if lcase(folderitem.name)  = lcase(sConnectionName) then  
hM4tY5]1UW    set oLanConnection = folderitem: exit for  
xn `:g4ER%L(ch end if  }([&RC%F Jfz
next  ,N6P3@xn!c
if oLanConnection is nothing then  
5`"VD4T^T msgbox "未找到 '" & sConnectionName & "' item"  
6[!s.qy~+\ wscript.quit  Ehp0F p.V7`_-X
end if  
&H8Pe(Q7ZnP {0] bEnabled = true  
&^Ar,j/pTn2l z set oEnableVerb = nothing  
1m^Oav`B(cu set oDisableVerb = nothing  @5jx0M&bY-xA)z%ZD
s = "Verbs: " & vbcrlf  
r jq~a.]j for each verb in oLanConnection.verbs  
m.V or _$wP s = s & vbcrlf & verb.name  
Fxi s3yh1Hu if verb.name = sEnableVerb then    |'b$vw'N
   set oEnableVerb = verb    e9xKOse3^E+z
   bEnabled = false  
)s1^$Da5j] end if  R^A/a B J)i
if verb.name = sDisableVerb then   j;p;Y }*J
   set oDisableVerb = verb   
5rvk5}-B%Ud end if  w@IW CoXs
next  F9O*HU@Pf:T?}GN
'debugging displays left just in case...  (uXs nBmG4ieY
'  
&g$\Y3?z3p Vih Ty 'msgbox s ': wscript.quit  
U0@&t+Xw.a+J0i 'msgbox "Enabled: " & bEnabled ': wscript.quit  [r5t?7Xg8q-R
'not sure why, but invokeverb always seemed to work   
$s#CAs'K 'for enable but not disable.    C^^J*P,A"UF+q
'  Zu6][e
'saving a reference to the appropriate verb object   &QXu;``0z
'and calling the DoIt method always seems to work.  W!A.].s`*k|8j6`,R"TY
'  b#Q)v$R9k4{
if bEnabled then  ,\pN,Jm,@
'  oLanConnection.invokeverb sDisableVerb  %w2r-^ P.b+Ru
oDisableVerb.DoIt  b@n8\/Gp7p E
else  *mS$z\E%gJSw
'  oLanConnection.invokeverb sEnableVerb  3DN"SW9l-YBE;o
oEnableVerb.DoIt  
+?(zs#}T Gj U end if  
xo0h)@M$L,A.s:o1t 'adjust the sleep duration below as needed...  *`ged!~ n7uuY
'  
'vE*n-O6V!E6_Y 'if you let the oLanConnection go out of scope  
0T1Q:pD6ve 'and be destroyed too soon, the action of the verb  tQA_4h[3|{ l
'may not take...  
Pj ]f&j:e '  8f@MM$M7B5j
wscript.sleep 400 [/code]

loved923 2008-2-20 22:48

我没用过无线的不清楚了
页: [1]
查看完整版本: 实用的问题--急急!!!