Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

syntax error netsh interface set interface ...DISABLED : to disable WiFi at MSDOS command prompt

Posted on 2011-02-20
15
Medium Priority
?
3,020 Views
Last Modified: 2012-05-11

As I did not get further responses on thread id   26831071
posting another one here.

can someone look further into why on my laptops (one is Dell D630 &
one is Thinkpad X61, both on Win XP Prof), I can't get the right syntax
so far for netsh command to disable WiFi.

Would also be good if someone gave me the exact syntax
for devcon as I can't get it right too.

The outputs & background info are in the other thread
0
Comment
Question by:sunhux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34938017
0
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 2000 total points
ID: 34938027
0
 

Author Comment

by:sunhux
ID: 34940762
0
Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34940896
What was the error message ?
0
 

Author Comment

by:sunhux
ID: 34942360

Extracted from the other thread id  26831071  the various
options I've tried & the message/error that were returned :


===============


Need someone to tell me where I went wrong with the command
syntax below :


D:\MRTG>netsh interface show interface

Admin State    State          Type             Interface Name
-------------------------------------------------------------------------
Enabled                       Dedicated        VMware Network Adapter VMnet1
Enabled                       Dedicated        Wireless Network Connection
Enabled                       Dedicated        VMware Network Adapter VMnet8
Enabled                       Dedicated        Local Area Connection
Enabled                       Internal         Internal
Enabled                       Loopback         Loopback


D:\MRTG>netsh interface set interface "Wireless Network Connection" DISABLED
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the
correct syntax.

Usage set interface [name = ] IfName
           [ [admin = ] ENABLED|DISABLED
             [connect = ] CONNECTED|DISCONNECTED
             [newname = ] NewName ]

     Sets interface parameters.

     IfName  - the name of the interface
     admin   - whether the interface should be enabled (non-LAN only).
     connect - whether to connect the interface (non-LAN only).
     newname - new name for the interface (LAN only).

     Notes:
     - At least one option other than the name must be specified.
     - If connect = CONNECTED is specified, then the interface
       is automatically enabled even if the admin = DISABLED
       option is specified.



D:\MRTG>netsh interface set interface "Wireless Network Connection"
ADMIN=DISABLED
ADMIN=DISABLED is not an acceptable value for admin.
The parameter is incorrect.



D:\MRTG>netsh interface SHOW interface "Wireless Network Connection"

Wireless Network Connection
  Type:                 Dedicated
  Administrative state: Enabled
  Connect state:


D:\MRTG>netsh interface set interface "Wireless Network Connection" ENABLED
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the
correct syntax.

Usage set interface [name = ] IfName
           [ [admin = ] ENABLED|DISABLED
             [connect = ] CONNECTED|DISCONNECTED
             [newname = ] NewName ]

     Sets interface parameters.

     IfName  - the name of the interface
     admin   - whether the interface should be enabled (non-LAN only).
     connect - whether to connect the interface (non-LAN only).
     newname - new name for the interface (LAN only).

     Notes:
     - At least one option other than the name must be specified.
     - If connect = CONNECTED is specified, then the interface
       is automatically enabled even if the admin = DISABLED
       option is specified.



D:\MRTG>netsh interface set interface "Wireless Network Connection" CONNECTED
CONNECTED is not an acceptable value for admin.
The parameter is incorrect.



D:\MRTG>netsh interface set interface "Wireless Network Connection"
connect=CONNECTED
connect=CONNECTED is not an acceptable value for admin.
The parameter is incorrect.



D:\MRTG>netsh interface set interface "Wireless Network Connection" "ENABLED"
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the
correct syntax.

Usage set interface [name = ] IfName
           [ [admin = ] ENABLED|DISABLED
             [connect = ] CONNECTED|DISCONNECTED
             [newname = ] NewName ]

     Sets interface parameters.

     IfName  - the name of the interface
     admin   - whether the interface should be enabled (non-LAN only).
     connect - whether to connect the interface (non-LAN only).
     newname - new name for the interface (LAN only).

     Notes:
     - At least one option other than the name must be specified.
     - If connect = CONNECTED is specified, then the interface
       is automatically enabled even if the admin = DISABLED
       option is specified.

===========================================================

I've just tried out Firew0lf's suggestion of using "Disable" & with exact case but no joy :

D:\shareware>netsh interface set interface "Wireless Network Connection" Disab

One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct syntax.

Usage set interface [name = ] IfName
            [ [admin = ] ENABLED|DISABLED
              [connect = ] CONNECTED|DISCONNECTED
              [newname = ] NewName ]

      Sets interface parameters.

      IfName  - the name of the interface
      admin   - whether the interface should be enabled (non-LAN only).
      connect - whether to connect the interface (non-LAN only).
      newname - new name for the interface (LAN only).

      Notes:
      - At least one option other than the name must be specified.
      - If connect = CONNECTED is specified, then the interface
        is automatically enabled even if the admin = DISABLED
        option is specified.


D:\shareware>netsh interface set interface "Wireless Network Connection" admin=Disable
admin=Disable is not an acceptable value for admin.
The parameter is incorrect.

Still no joy from my end despite I've renamed by Wireless NIC to "WirelessNIC" :

C:\>netsh interface show interface | find/i "wireles"
Enabled                       Dedicated        WirelessNIC


C:\>netsh interface set interface "WirelessNIC" admin=disabled
admin=disabled is not an acceptable value for admin.
The parameter is incorrect.



C:\>netsh interface set interface "WirelessNIC" admin=DISABLED
admin=DISABLED is not an acceptable value for admin.
The parameter is incorrect.


C:\>netsh interface set interface "WirelessNIC" DISABLED
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct sy
ntax.

Usage set interface [name = ] IfName
            [ [admin = ] ENABLED|DISABLED
              [connect = ] CONNECTED|DISCONNECTED
              [newname = ] NewName ]

      Sets interface parameters.

      IfName  - the name of the interface
      admin   - whether the interface should be enabled (non-LAN only).
      connect - whether to connect the interface (non-LAN only).
      newname - new name for the interface (LAN only).

      Notes:
      - At least one option other than the name must be specified.
      - If connect = CONNECTED is specified, then the interface
        is automatically enabled even if the admin = DISABLED
        option is specified.


C:\>netsh interface set interface "WirelessNIC" DISABLE
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct sy
ntax.

Usage set interface [name = ] IfName
            [ [admin = ] ENABLED|DISABLED
              [connect = ] CONNECTED|DISCONNECTED
              [newname = ] NewName ]

      Sets interface parameters.

      IfName  - the name of the interface
      admin   - whether the interface should be enabled (non-LAN only).
      connect - whether to connect the interface (non-LAN only).
      newname - new name for the interface (LAN only).

      Notes:
      - At least one option other than the name must be specified.
      - If connect = CONNECTED is specified, then the interface
        is automatically enabled even if the admin = DISABLED
        option is specified.




C:\>netsh interface set interface "WirelessNIC" admin=DISCONNECTED
admin=DISCONNECTED is not an acceptable value for admin.
The parameter is incorrect.



C:\>netsh interface set interface "WirelessNIC" admin="DISABLED"
admin=DISABLED is not an acceptable value for admin.
The parameter is incorrect.



C:\>netsh interface set interface "WirelessNIC" admin="DISABLE"
admin=DISABLE is not an acceptable value for admin.
The parameter is incorrect.
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34942570
this should be
netsh interface set interface name="WirelessNIC"
0
 
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 2000 total points
ID: 34942610
0
 

Author Comment

by:sunhux
ID: 34943374

I'm running Win XP Professional on both laptops : do they come with PowerShell?
Thought PowerShell comes with Windows 7?

I tried your 2nd last post & appeared that the commandline didn't work.
Strange, why then did Microsoft include "netset ...set ... Disabled" in
the commandline help?


========= Test results of your 2nd last post, thread id 34942570 ===========

D:\>netsh interface set interface name="WirelessNIC" DISABLE
The parameter is incorrect.

D:\>netsh interface set interface name="WirelessNIC" DISABLED
The parameter is incorrect.

D:\>netsh interface show interface
Admin State    State          Type             Interface Name
-------------------------------------------------------------------------
Enabled                       Dedicated        1394 Connection 8
Enabled                       Dedicated        WirelessNIC
Enabled                       Dedicated        1394 Connection 7
Enabled                       Dedicated        1394 Connection
Enabled                       Dedicated        1394 Connection 6
Enabled                       Dedicated        1394 Connection 9
Enabled                       Dedicated        Local Area Connection 5
Enabled                       Dedicated        1394 Connection 11
Enabled                       Dedicated        1394 Connection 4
Enabled                       Dedicated        Local Area Connection
Enabled                       Dedicated        1394 Connection 5
Enabled                       Dedicated        1394 Connection 10
Enabled                       Dedicated        1394 Connection 3
Enabled                       Dedicated        1394 Connection 2
Enabled                       Dedicated        Cisco AnyConnect Secure Mobility Client Connection
0
 

Author Comment

by:sunhux
ID: 34943395

& the reason I want to enable & then disable back the WiFi interface about a minute
later is for security reason : just wanted to copy files via the WiFi & once it's done,
immediately turn off WiFi
0
 

Author Comment

by:sunhux
ID: 34943434

Perhaps we should pursue the option of using devcon utility but I can't
seem to be sure of the syntax
0
 
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 2000 total points
ID: 34945094
How about that powershell of wmi options ?
You may download PS for XP
http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx
0
 

Author Comment

by:sunhux
ID: 34948848

Will give that a try & revert back in 2 days' time.

devcon is no good : it gave sort of strange results : trying to disable
WiFi will say nothing to disable & enable always says OK but
when I check on status of WiFi it's not consistent
0
 

Author Comment

by:sunhux
ID: 34951788

I've downloaded & installed PowerShell for Win XP & no joy as well :



PS C:\Documents and Settings\Administrator> netsh interface set interface name="WirelessNIC" DISABLED
The parameter is incorrect.


PS C:\Documents and Settings\Administrator> netsh interface set interface name=WirelessNIC DISABLE
The parameter is incorrect.


PS C:\Documents and Settings\Administrator> netsh interface set interface name=WirelessNIC DISABLED
The parameter is incorrect.


PS C:\Documents and Settings\Administrator> netsh interface set interface name = WirelessNIC DISABLED
The parameter is incorrect.


PS C:\Documents and Settings\Administrator> netsh interface set interface WirelessNIC ADMIN=DISABLED
ADMIN=DISABLED is not an acceptable value for admin.
The parameter is incorrect.


PS C:\Documents and Settings\Administrator> netsh interface set interface "WirelessNIC" admin=DISABLED
admin=DISABLED is not an acceptable value for admin.
The parameter is incorrect.
0
 
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 2000 total points
ID: 34951827
0
 

Author Closing Comment

by:sunhux
ID: 35095383
ok
0

Featured Post

Introducing the WatchGuard 420 Access Point

WatchGuard's newest access point includes an 802.11ac Wave 2 chipset, providing the fastest speeds for VoIP, video and music streaming, and large data file transfers. Additionally, enjoy the benefits of strong security as the 3rd radio delivers dedicated WIPS protection!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question