Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
drgt
- Posts: 160
- Joined: 21 Sep 2010 02:22
- Location: Greece
#1
Post
by drgt » 19 Mar 2017 06:28
I tried to use
Code: Select all
netsh interface set interface "Local Area Connection" DISABLED
but I get
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct syntax.
Please help me with the correct syntax.
xp sp2
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#2
Post
by ShadowThief » 19 Mar 2017 08:34
It may be expecting you to explicitly name the parameters.
Code: Select all
netsh interface set interface name="Local Area Connection" admin=DISABLED
It's also possible that you don't have an interface called "Local Area Connection." You may want to run
to see what your options are.
-
drgt
- Posts: 160
- Joined: 21 Sep 2010 02:22
- Location: Greece
#3
Post
by drgt » 19 Mar 2017 13:51
Admin State State Type Interface Name
-----------------------------------------------------------------------
Enabled Dedicated Local Area Connection 9
Enabled Dedicated Local Area Connection 3
Enabled Dedicated Local Area Connection
Enabled Internal Internal
Enabled Loopback Loopback
Code: Select all
netsh interface set interface name="Local Area Connection" admin=DISABLED
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct syntax.
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#4
Post
by ShadowThief » 19 Mar 2017 14:18
Weird, that should totally work. And
doesn't give any additional information about what it's expecting?
-
drgt
- Posts: 160
- Joined: 21 Sep 2010 02:22
- Location: Greece
#5
Post
by drgt » 19 Mar 2017 14:21
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.
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#6
Post
by ShadowThief » 19 Mar 2017 14:32
You're typing this instead of running it from a script? And you're not obfuscating the LAN name on here for some reason?
-
drgt
- Posts: 160
- Joined: 21 Sep 2010 02:22
- Location: Greece
#7
Post
by drgt » 19 Mar 2017 14:41
I am giving this command in command prompt window. Yes I type it in (or I paste it in).
Those are the exact names as they appear.
I changed the name to Local_Area_Connection and tried it again with and without quotes.
Same thing!
Weird indeed.
*plus I do not know what local area connections 3 and 9 are!
EDIT: What is "non-LAN only" in (admin - whether the interface should be enabled (non-LAN only))?
-
drgt
- Posts: 160
- Joined: 21 Sep 2010 02:22
- Location: Greece
#10
Post
by drgt » 20 Mar 2017 02:57
Suppose I want to edit a desktop shortcut to execute a devcon command before, I simply create a batch file that includes both the devcon command and the shortcut code OR there is a better way?