Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: 16 May 2006 09:23:56 -0700,    group: microsoft.public.inetsdk.programming.scripting.vbscript        back       


Srcipt Adapter network   
Hi people,
Anyone knows how to create a Sub to update network card??
For example my script check connection if True restarts my service, is
not update network card, but I can“t use my Sub UpdateAdapter anyone
can show me wrong???

If boolWireless = True Then
   Set colServiceList = objWMIService.ExecQuery ("Select * from
Win32_Service where Name='SWFTPClient'")
   For Each objService In colServiceList
      teste = objService.ChangeStartMode("Automatic")
      objService.StartService()
      WScript.Echo "Iniciado"
   Next
   Else
   boolWireless = False
   UpdateAdapter objItem.NetConnectionID, True


End If


Sub UpdateAdapter(targetConnection, enable)
Set sa = CreateObject("Shell.Application")
Set NetConn = sa.Namespace(49)
Set Connections = NetConn.Items


For i = 0 To Connections.Count - 1
   If Connections.Item(i).Name = targetConnection Then
   Set cnx = Connections.Item(i)
      If (enable and cnx.Verbs.Item(0).Name = "En&able") or (not enable



and cnx.Verbs.Item(0).Name = "Disa&ble") then cnx.Verbs.Item(0).DoIt()
        WScript.Sleep 10000
      End If


Next
End Sub


So Shinbaum give me tip, but I need help to can do this!!! Anyone can
help how I begin to mount this function???


(Crash,


You will need to destroy the connection and create a new one to get the



updated status.


I would suggest that you make a function that returns the status.
Inside the
fucntion is where you open the connection to get the status, then at
the end
of the function close the connection. That way each time you call the
function you will get the current status. 


Shinbaum)
date: 16 May 2006 09:23:56 -0700   author:   CrashGirl

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us