Enabling TCPIP

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Enabling TCPIP

#1 Post by miskox » 17 Jan 2022 12:37

Hello!

I have a Win XP computer (XP PRO, 32-bit) which has TCP/IP disabled by default. When I need IP connection I enable it (usualy once a month to upload a file):
- I go to network connections
- I select a network connection
- right click and I select Internet Protocol (TCP/IP)

(see image).
Image

My questions are:

- how do I enable TCP/IP from batch
- how do I disable TCP/IP from batch

I tried NETSH - no luck.

Code: Select all

C:\>netsh interface show interface

Admin State    State          Type             Interface Name
-------------------------------------------------------------------------
Enabled                       Dedicated        Local Area Connection
Enabled                       Internal         Internal
Enabled                       Loopback         Loopback

C:\>
I can change IP address, static/DHCP... but DHCP is already set so NETSH displays that. So nothing useful here (I guess - I might be missing something).

IPCONFIG shows this when TCP/IP is not enabled:

Code: Select all

C:\>ipconfig

Windows IP Configuration

C:\>
So I guess IPCONFIG cannot be used, too.

Any ideas if this is doable? I prefer native commands, if not powershell might do.

I checked registry. There might be something under the [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\{8194DEBE-9B35-4C9A-B061-7EFF371F9F9F}]
but nothing happens when I insert keys from the .reg file (I did file comparisons (registry export before/after) - many differences are there that should probably be changed)).

Thanks.
Saso

shenkee
Posts: 1
Joined: 18 Jan 2022 04:03

Re: Enabling TCPIP

#2 Post by shenkee » 19 Jan 2022 03:11

Hi, Saso,
If I see it well, there are no other protocols installed. Won't be enough to disable the network adapter itself?
(Sorry for my bad English.)
Shenkee

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: Enabling TCPIP

#3 Post by miskox » 20 Jan 2022 00:56

Thanks for the tip...but I cannot disable the network adapter because it must be enabled to access internet thru virtual machines (host machine does not have an IP (disabled), virtual machines can access internet).

Saso

jfl
Posts: 226
Joined: 26 Oct 2012 06:40
Location: Saint Hilaire du Touvet, France
Contact:

Re: Enabling TCPIP

#4 Post by jfl » 24 Jan 2022 03:58

PowerShell would probably be the good choice, as it has a rich set of network management functions. But in Windows XP you're limited to PowerShell v2, so I don't know how much is there yet.

In the old cmd shell, you have the choice of netsh.exe, and wmic.exe (Ex: wmic nicconfig /?). Both are powerful, but complex to use.

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: Enabling TCPIP

#5 Post by miskox » 24 Jan 2022 05:44

Thanks.I will see what can be done with WMIC.

Saso

Post Reply