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

RAS

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

Modifying NetProtocols of an existing connectoid

 Keywords:  edit NetProtocols Protocol connectoid PhoneBook NetBeui IPX TCP/IP 

Question:

I need to modify the network components selected on an existing Connectiod. How would you do that using the RAS extender?

Answer:

;an example, using the RAS Extender, to modify NetProtocols of an existing connectoid....
AddExtender("wwras34i.dll",10006)
list = RasItemize() 
entryname = AskItemlist("Choose a RAS entry",list,@TAB,@UNSORTED,@SINGLE)

allinfo=rasEntryInfo(entryname,'all')
Arr_Values = Arrayize(allinfo,"|")
Valuecount = ArrInfo(Arr_Values,6)

elementlist="size|options|countryid|countrycode|areacode|phonenumber|ipaddr|ipaddrdns|ipaddrdnsalt|ipaddrwins|ipaddrwinsalt|framesize|"
elementlist2="netprotocols|framingprotocol|script|autodialdll|autodialfunc|devicetype|devicename|x25padtype|x25address|x25facilities|x25userdata|"
elementlist3="channels|subentries|dialmode|dialextrapercent|dialextrasampleseconds|hangupextrapercent|hangupextrasampleseconds|idledisconnectseconds|"
elementlist4= "type|encryptiontype|customauthkey|customdialdll|vpnstrategy|options2|dnssuffix|tcpwindowsize|prerequisitepbk|prerequisiteentry|redialcount|redialpause"
List_Elements = strcat(elementlist,elementlist2,elementlist3,elementlist4)
Arr_Elements = Arrayize(List_Elements,"|")
Elementcount = ArrInfo(Arr_Elements,6)

;initalize structure ***IMPORTANT**
RasEntrySet("","")

;First reset all the same elements
For x = 0 to Valuecount-1
 if StrLower(Arr_Elements[x]) == "netprotocols"
    ;Elements to Edit
	 ;"NetProtocols"
	 ;1	RASNP_NetBEUI	Negotiate the NetBEUI protocol.
	 ;2	RASNP_Ipx	Negotiate the IPX protocol.
	 ;4	RASNP_Ip	Negotiate the TCP/IP protocol.
    Arr_Values[x]= 6
 endif
 RasEntrySet(Arr_Elements[x],Arr_Values[x])  
Next 


;Add New entry
username = AskLine("Ras Entry: %entryname%", "Please enter the user name to connect with", "")
pswd =  AskPassword("Ras Entry: %entryname%", "Please enter the password to connect with")
RasEntryAdd(StrCat("new_",entryname), username, pswd, @true, 0)
Message("Done","Ras Entry Modified")
exit

Using 10005 or older versions of the Ras Extender:
;an example, using the RAS Extender, to modify
;NetProtocols of an existing connectoid....
AddExtender("wwras34i.dll")
list = RasItemize() 
entryname = AskItemlist("Choose a RAS entry",list,@TAB,@UNSORTED,@SINGLE)

allinfo=rasEntryInfo(entryname,'all')
Arr_Values = Arrayize(allinfo,"|")
Valuecount = ArrInfo(Arr_Values,6)

elementlist="size|options|countryid|countrycode|areacode|phonenumber|devicename|devicetype|"
elementlist2="ipaddr|ipaddrdns|ipaddrdnsalt|ipaddrwins|ipaddrwinsalt|framesize|netprotocols|framingprotocol|script|autodialdll|autodialfunc|"

elementlist3="subentries|dialmode|dialextrapercent|dialextrasampleseconds|hangupextrapercent|hangupextrasampleseconds|idledisconnectseconds|"
elementlist4= "type|encryptiontype|customauthkey|customdialdll|vpnstrategy"

List_Elements = strcat(elementlist,elementlist2,elementlist3,elementlist4)
Arr_Elements = Arrayize(List_Elements,"|")
Elementcount = ArrInfo(Arr_Elements,6)

;initalize structure ***IMPORTANT**
RasEntrySet("","")

;First reset all the same elements
For x = 0 to Valuecount-1
 RasEntrySet(Arr_Elements[x],Arr_Values[x])  
Next 

;Elements to Edit
;"NetProtocols"
;1	RASNP_NetBEUI	Negotiate the NetBEUI protocol.
;2	RASNP_Ipx	Negotiate the IPX protocol.
;4	RASNP_Ip	Negotiate the TCP/IP protocol.
RasEntrySet("netprotocols",2) ;only set IPX protocol<<<<<<<<<<<<< 

;Add New entry
RasEntryAdd(entryname, "", "", 0, 0)
Message("Done","Ras Entry Modified")
exit


Question 2:

I've got this connectoid that I want to add IPX to (so that I have both IP and IPX enabled) and I'm using the netprotocols option to set it like one of the examples in the Tech Support web page. It sets the IPX protocol correctly, however in the process unchecks the "Client for Microsoft Networks". Any ideas why or how to keep this still checked?

This is what I'm using to set it:

RasEntrySet("netprotocols",6)

I even did some troubleshooting to see if I could figure out if there was another option in the rasentryset that I needed to use besides netprotocols.

So I used:

rasentryinfo(entryname, "all")
and compared two connectoids that were identical except for one had the client for MS networks checked and the other one didn't. All of the options that are able to be set showed up identical. I'm running this on XP.

Any ideas? Thanks in advance.

Answer 2:

I am unable to recreate the problem. I am using version 10006 of the RAS extender, on my Windows XP machine.

First, make sure you are running latest version of the Ras Extender. It can be downloaded from http://www.winbatch.com/download.html#dlwilextenders

I used the following code for testing:

;an example, using the RAS Extender, to modify NetProtocols of an existing connectoid....
DebugTrace(@on,"trace.txt")
AddExtender("wwras34i.dll",10006)
list = RasItemize() 
entryname = AskItemlist("Choose a RAS entry",list,@TAB,@UNSORTED,@SINGLE)

allinfo=rasEntryInfo(entryname,'all')
Arr_Values = Arrayize(allinfo,"|")
Valuecount = ArrInfo(Arr_Values,6)

elementlist="size|options|countryid|countrycode|areacode|phonenumber|ipaddr|ipaddrdns|ipaddrdnsalt|ipaddrwins|ipaddrwinsalt|framesize|"
elementlist2="netprotocols|framingprotocol|script|autodialdll|autodialfunc|devicetype|devicename|x25padtype|x25address|x25facilities|x25userdata|"
elementlist3="channels|subentries|dialmode|dialextrapercent|dialextrasampleseconds|hangupextrapercent|hangupextrasampleseconds|idledisconnectseconds|"
elementlist4= "type|encryptiontype|customauthkey|customdialdll|vpnstrategy|options2|dnssuffix|tcpwindowsize|prerequisitepbk|prerequisiteentry|redialcount|redialpause"
List_Elements = strcat(elementlist,elementlist2,elementlist3,elementlist4)
Arr_Elements = Arrayize(List_Elements,"|")
Elementcount = ArrInfo(Arr_Elements,6)

;initalize structure ***IMPORTANT**
RasEntrySet("","")

;First reset all the same elements
For x = 0 to Valuecount-1
 if StrLower(Arr_Elements[x]) == "netprotocols"
    ;Elements to Edit
	 ;"NetProtocols"
	 ;1	RASNP_NetBEUI	Negotiate the NetBEUI protocol.
	 ;2	RASNP_Ipx	Negotiate the IPX protocol.
	 ;4	RASNP_Ip	Negotiate the TCP/IP protocol.
    Arr_Values[x]= 6
 endif
 RasEntrySet(Arr_Elements[x],Arr_Values[x])  
Next 


;Add New entry
username = AskLine("Ras Entry: %entryname%", "Please enter the user name to connect with", "")
pswd =  AskPassword("Ras Entry: %entryname%", "Please enter the password to connect with")
RasEntryAdd(StrCat("new_",entryname), username, pswd, @true, 0)
Message("Done","Ras Entry Modified")
exit

Article ID:   W14794
File Created: 2017:07:28:13:58:40
Last Updated: 2003:04:04:15:29:34