WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Control Manager
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Launch TCPIP Properties Dialog

 Keywords: TCP IP Internet Protocol Network Connections 2K XP 

Question:

How do I Launch the Internet Protocol (TCP/IP) Properties Dialog on Windows 2000 and XP?

Answer:

I would recommend using the Roboscripter to help generate the code for you. The code will be slightly different for each platform:


For Windows XP
;Designed for Windows XP
; This code launches the Network Connections dialog, right clicks on the Local Area Connection icon 
; which launches the Local Area Connection Properties, selects 'Internet Protocol (TCP/IP)' from the list
; then selects the properties button which launches the 'Internet Protocol (TCP/IP) Properites' dialog.

Run("control.exe","ncpa.cpl") 
ret = WinWaitExist("Network Connections", 20)
if ret == @false 
	message("Could not locate","Network Connections")
	exit
endif

;RoboScripter
; Made with 
;   RoboScripter ver: 29
;   CtlMgr ver: 20028
AddExtender("wwctl34i.dll")

;Title: FolderView
;ID: 1
;Class: SysListView32
;Level: 3
window1=cWndByWndSpec("CabinetWClass","explorer",4,40965,9999,40961,0)
window2=cWndByClass(window1,`SHELLDLL_DefView`)
ControlHandle=cWndByClass(window2,`SysListView32`)
cSetFocus(ControlHandle)  ; Activates Window
wintext=cGetLVText(ControlHandle)     ;Get first column of SysLsitView32 text
;Get the index of the item
myitem="Local Area Connection"
select1=ItemLocate(myitem, wintext, @tab)
if select1
   cSetLVitem(ControlHandle,select1)     ;Set a SysListView32 item 
else
  Message(myitem,"Doesn't Exist")
  exit
endif
;right click and select properites
Sendkey("+{F10}r")

ret = WinWaitExist("Local Area Connection Properties", 10)
if ret == @false 
	message("Could not locate","Local Area Connection Properties")
	exit
endif

;Select general tab
window1=cWndByWndSpec("#32770","explorer",6,0,1,2,12321,9,12320)
ControlHandle=cWndByID(window1,12320)
result=cSetTABItem(ControlHandle,1)     ;Sets a Tabbed dialog item


;Title: 
;ID: 15007
;Class: SysListView32
;Level: 3
window1=cWndByWndSpec("#32770","explorer",6,0,1,2,12321,9,12320)
window2=cWndByName(window1,`General~`)
ControlHandle=cWndByID(window2,15007)
wintext=cGetLVText(ControlHandle)     ;Get first column of SysLsitView32 text


;Get the index of the item
myitem="Internet Protocol (TCP/IP)"
select1=ItemLocate(myitem, wintext, @tab)
if select1
   cSetLVitem(ControlHandle,select1)     ;Set a SysListView32 item 
else
  Message(myitem,"Doesn't Exist")
  exit
endif


;Title: P&roperties
;ID: 15011
;Class: Button0
;Level: 3
window1=cWndByWndSpec("#32770","explorer",6,0,1,2,12321,9,12320)
window2=cWndByName(window1,`General~`)
ControlHandle=cWndByID(window2,15011)
cPostButton(ControlHandle)      ;Alternate to cClickButton

For Windows 2000
;Designed for Windows 2000
; This code launches the 'Network and Dial-up Connections'dialog, selecta the 'Local Area Connection' icon 
; from the list which launches the 'Local Area Connection Properties' dialog, selects 'Internet Protocol (TCP/IP)' 
; from the list then selects the properties button which launches the 'Internet Protocol (TCP/IP) Properites' dialog.


Run("control.exe","ncpa.cpl") 

ret = WinWaitExist("Network and Dial-up Connections", 20)
if ret == @false 
	message("Could not locate","Network and Dial-up Connections")
	exit
endif
;RoboScripter
; Made with 
;   RoboScripter ver: 29
;   CtlMgr ver: 20028
AddExtender("wwctl34i.dll")

;Title: 
;ID: 1
;Class: SysListView32
;Level: 3
window1=cWndByWndSpec("ExploreWClass","Explorer",5,40965,9999,40961,0,0)
window2=cWndByClass(window1,`SHELLDLL_DefView`)
ControlHandle=cWndByClass(window2,`SysListView32`)
cSetFocus(ControlHandle)  ; Activates Window
wintext=cGetLVText(ControlHandle)     ;Get first column of SysLsitView32 text

;Get the index of the item
myitem="Local Area Connection"
select1=ItemLocate(myitem, wintext, @tab)
if select1
   cSetLVitem(ControlHandle,select1)     ;Set a SysListView32 item 
else
  Message(myitem,"Doesn't Exist")
  exit
endif
;right click and select properites
Sendkey("+{F10}r")

ret = WinWaitExist("Local Area Connection Properties", 10)
if ret == @false 
	message("Could not locate","Local Area Connection Properties")
	exit
endif



;Title: 
;ID: 15007
;Class: SysListView32
;Level: 3
window1=cWndByWndSpec("#32770","Explorer",6,0,1,2,12321,9,12320)
window2=cWndByName(window1,`General~`)
ControlHandle=cWndByClass(window2,`SysListView32`)
wintext=cGetLVText(ControlHandle)     ;Get first column of SysListView32 text

;Get the index of the item
myitem="Internet Protocol (TCP/IP)"
select1=ItemLocate(myitem, wintext, @tab)
if select1
   cSetLVitem(ControlHandle,select1)     ;Set a SysListView32 item 
else
  Message(myitem,"Doesn't Exist")
  exit
endif

;Title: P&roperties
;ID: 15011
;Class: Button0
;Level: 3
window1=cWndByWndSpec("#32770","Explorer",6,0,1,2,12321,9,12320)
window2=cWndByName(window1,`General~`)
ControlHandle=cWndByName(window2,`Properties~`)
cPostButton(ControlHandle)      ;Alternate to cClickButton

Article ID:   W15396
File Created: 2017:07:28:12:58:27
Last Updated: 2003:05:13:10:27:28