| View previous topic :: View next topic |
| Author |
Message |
Bart Valued Newbie
Joined: 24 Jun 2003 Posts: 41 Location: Netherlands
|
Posted: Tue Aug 07, 2007 9:16 am Post subject: setting NIC |
|
|
| I need to read and set the NIC via VDS, when running XP i use IPconfig and pipe the outcome, and netsh to make the settings, but i need also read and set the NIC under Win98 with the same software. How can i do the trick? |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Aug 07, 2007 10:27 am Post subject: |
|
|
Hi Bart
You might try Dr. Dread's DreadNet.dll available on the main www.vdsworld.com site...
Nathan |
|
| Back to top |
|
 |
Bart Valued Newbie
Joined: 24 Jun 2003 Posts: 41 Location: Netherlands
|
Posted: Tue Aug 07, 2007 10:37 am Post subject: |
|
|
| I tried that one but it only reads some information, i need al the information like in IPCONFIG /ALL but also need to set all the parameters. |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Tue Aug 07, 2007 12:55 pm Post subject: |
|
|
I assume you've can't use winipcfg? I can't remember what info it provides though if I remember correctly it's a gui app. _________________ cheers
Dave |
|
| Back to top |
|
 |
Bart Valued Newbie
Joined: 24 Jun 2003 Posts: 41 Location: Netherlands
|
Posted: Tue Aug 07, 2007 1:04 pm Post subject: |
|
|
Yes winipcfg can be run from the commandline and i just figured out that if i use the next line:
run winipcfg /all /batch c:\ip.dat,wait
this give the same results as
run ipconfig /all,wait
and doesn't show the GUI of winipcfg, but not the only difference is that it is stored in the file but that is no problem, but i need a way of changing the NIC settings. |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Aug 07, 2007 9:42 pm Post subject: |
|
|
On NT systems you can change it in the registry after you figure out what the interface ID is. I can't remember how to do it in WinXX systems because its been a very long time since I even dealt with it.
For NT based OS's look in the registry at:
HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
One of the interfaces is your active one. In that key it will have most of the settings you are looking for including DNS.
For WINS settings look at: (The interface KeyName will be the same as above)
HKLM\System\CurrentControlSet\Services\NetBT\Parameters\Interfaces
After making changes in these two keys you will need to restart the "Network Connections" service
| Code: | runh sc stop netman,wait
runh sc start netman,wait |
or if it's running XP and the Windows Firewal
| Code: | runh sc stop netman,wait
runh sc stop SharedAccess,wait
runh sc start netman,wait
runh sc start SharedAccess,wait |
Note: You may experience errors if the Windows Firewall is disabled so you might want to check it first.
| Code: | runh sc qc SharedAccess,pipe
list add,SvcList,@pipe()
%A = @match(SvcList,Auto_Start)
If @OK()
runh sc stop netman,wait
runh sc stop SharedAccess,wait
runh sc start netman,wait
runh sc start SharedAccess,wait
else
runh sc stop netman,wait
runh sc start netman,wait
end |
To find the active InterfaceID you might try parsing the output of:
| Code: | | runh net config workstation,@pipe |
It aslo may be that the DreadNet.dll can tell you the InterFaceID. I haven't tried
Goog Luck  |
|
| Back to top |
|
 |
Bart Valued Newbie
Joined: 24 Jun 2003 Posts: 41 Location: Netherlands
|
Posted: Wed Aug 08, 2007 1:41 pm Post subject: |
|
|
I found it, wasn't that difficult
to set DHCP ON:
| Code: |
%T = 0
repeat
if @not(@null(@regread(LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,IPAddress)))
registry write,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,IPAddress,0.0.0.0
registry write,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,IPMask,0.0.0.0
registry write,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,EnableDNS,0
registry delete,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,DefaultGateway
registry delete,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,Domain
registry delete,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,HostName
registry delete,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,NameServer
registry delete,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,SearchList,
end
%T = @succ(%T)
until @greater(%T,9)
|
tot set Static IP
| Code: |
%T = 0
repeat
if @not(@null(@regread(LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,IPAddress)))
registry write,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,IPAddress,123.123.123.123
registry write,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,IPMask,255.255.255.0
registry write,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,EnableDNS,1
registry write,LOCAL,System\CurrentControlSet\Services\Class\NetTrans\000%T,DefaultGateway,123.123.123.124
registry write,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,Domain,Blaat1
registry write,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,HostName,Blaat2
registry write,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,NameServer,234.234.234.234
registry write,LOCAL,System\CurrentControlSet\Services\VxD\MSTCP,SearchList,
end
%T = @succ(%T)
until @greater(%T,9)
|
the repeat is to search for the card this isn't always 0000 or 0001 for example, after setting this values there is a reboot needed to activate. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|