forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


setting NIC

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Tue Aug 07, 2007 9:16 am    Post subject: setting NIC Reply with quote

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
View user's profile Send private message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Tue Aug 07, 2007 10:27 am    Post subject: Reply with quote

Hi Bart

You might try Dr. Dread's DreadNet.dll available on the main www.vdsworld.com site...

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Tue Aug 07, 2007 10:37 am    Post subject: Reply with quote

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
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Tue Aug 07, 2007 12:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Tue Aug 07, 2007 1:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Aug 07, 2007 9:42 pm    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message Send e-mail
Bart
Valued Newbie


Joined: 24 Jun 2003
Posts: 41
Location: Netherlands

PostPosted: Wed Aug 08, 2007 1:41 pm    Post subject: Reply with quote

I found it, wasn't that difficult Shocked

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group