Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: RAS 205 Unable to Create Phonebook Entry
AddExtender("wwras34i.dll") ;initalize structure ***IMPORTANT** RasEntrySet("","") RasEntrySet("options",793) RasEntrySet("areacode","206") RasEntrySet("phonenumber","5551234") devicename = "FEM656C-3Com Global 10-100+56K CardBus PC Card -(Modem)" RasEntrySet("devicename",devicename) RasEntrySet("devicetype","modem") RasEntrySet("framingprotocol",1) ;Add New entry newentryname="MyRasConnection2" RasEntryAdd(newentryname, "", "", 0, 0) Message("Done","New Ras Entry Created") exitI looked in the wwwbatch.ini file for the lasterror value, which was [87 - Invalid Parameter] .
The option value you are specifying, as 793, is valid for Win9x. The 205 error can be a result of passing a bad device name. Please check the device name *very* closely.
If that is not the problem. Then manually create a RAS entry, exactly like you want WinBatch to create. Then run the following code against that connection. This code will display all the entry information. NOTE: Pay close attention to the Options value and Device Name value. Make sure you script refernces both those same *EXACT* values.
AddExtender("wwras34i.dll",10006) raslist = RasItemize() entryname = AskItemlist("Choose a RAS entry",raslist,@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) list="" For x = 0 to Valuecount-1 list = strcat(list, Strfix(Arr_Elements[x], " ",30),@Tab,Arr_Values[x],@CRLF) Next message("RasEntryInfo",list) exit
Addextender ("wwras34i.dll") coms = environment ("comspec") user = environment ("username") if regexistkey(@regmachine, "System\CurrentControlSet\Services\Class\Modem\0000") modemtype = regqueryvalue (@regmachine, "System\CurrentControlSet\Services\Class\Modem\0000[Model]") else exit endif RasEntrySet("","") Rasentryset("Options", "8985") Rasentryset("AreaCode", "410") RasEntrySet("PhoneNumber", "555-1212") RasEntrySet("NetProtocols", 7) RasEntrySet("Devicetype", "modem") RasEntryset("Devicename", modemtype) Rasentryadd("Test", "User", "pass", 1, 0)
They are: Options, AreaCode, PhoneNumber, FramingProtocol, DeviceType, DeviceName
Note: The options element specified set RASEO_UseCountryAndAreaCodes. If this flag is set, the CountryID, CountryCode, and AreaCode elements are used to construct the phone number. If this flag is not set, these elements are ignored. This flag corresponds to the Use Country and Area Codes check boxes in the Phone dialog box.
Therefore you will also need to specify the CountryID, CountryCode, and AreaCode elements in your script.
I have attached the revised code. I tested on a Win98 machine and was able to successfully create a DUN Connectiod.
Hope this helps,
Addextender ("wwras34i.dll") coms = environment ("comspec") user = environment ("username") if regexistkey(@regmachine, "System\CurrentControlSet\Services\Class\Modem\0000") modemtype = regqueryvalue (@regmachine, "System\CurrentControlSet\Services\Class\Modem\0000[Model]") else exit endif RasEntrySet("","") Rasentryset("Options", "8985") RasEntrySet("CountryID", "1") Rasentryset("Countrycode", "1") Rasentryset("AreaCode", "410") RasEntrySet("PhoneNumber", "555-1212") RasEntrySet("NetProtocols", 7) RasEntrySet("FramingProtocol", 1) RasEntrySet("Devicetype", "modem") RasEntryset("Devicename", modemtype) Rasentryadd("Test", "User", "pass", 1, 0)
Article ID: W15083
File Created: 2003:02:10:12:34:18
Last Updated: 2003:02:10:12:34:18