Batch files that work on W7 but not W10

teckneeculler

Member
Power User
VIP
Local time
7:47 AM
Messages
512
If I open my Win7 computer's Network and Sharing Center and click 'Change adapter settings', I see an icon of two computer monitors, with the label 'Local Area Connection 2'.

A couple of years back, with the aid of some kind folks here, I set up two batch files to Enable and Disable 'Local Area Connection 2'. They both work well. The 'Disable' bat works via Task Scheduler at 1.00am, the Enable bat I activate manually in the morning. The batch commands read "netsh interface set interface "Local Area Connection 2" enable" and similar for the disable bat.

A couple of months ago I started to build an experimental W10 Pro computer, mainly to see if I could tweak it into a state that closely resembles my W7 machine. Just now I tried to set up the exact same two batch commands as are running on the W7 pc, on the W10 machine, with the slightly different target of "Ethernet", which is the name I found in 'Change adapter settings' folder in W10.

But, on the Windows 10 computer, these batch files don't work, even with UAC turned off.

However I made two desktop shortcuts that DO work. The text (found online) I entered when asked to 'Type the location of the item" reads: netsh interface set interface name="yourname" admin = disabled. After substituting 'Ethernet' for 'yourname' both shortcuts work, although they take a second or two to activate. Opening them again now, the full paths read:
C:\System32\netsh.exe netsh interface set interface name="Ethernet" admin = disabled (or enabled)

I'm curious as to why the simpler W7 batch files don't work on the 10 machine. Anyone have a clue?
 

My Computer My Computer

At a glance

Win7 Ultimate SP1Intel Core i5 9400 Coffee Lake 14nm16G DDR4NVidia GeForce GTX 960
Computer type
PC/Desktop
Computer Manufacturer/Model Number
My build
OS
Win7 Ultimate SP1
CPU
Intel Core i5 9400 Coffee Lake 14nm
Motherboard
Asus Prime H310M-E R2.0 (LGA1151)
Memory
16G DDR4
Graphics Card(s)
NVidia GeForce GTX 960
Sound Card
Realtek High Definition Audio (mobo)
Monitor(s) Displays
Asus PA248 24" 16:10 format
Screen Resolution
1920x1200@59Hz
Hard Drives
1863GB Seagate ST2000DM
3726GB Seagate ST4000DM
1863GB Seagate ST2000DM
6TB Seagate
465GB NVMe Samsung SSD 970
PSU
750G2
Case
Tower
Cooling
Standard
Keyboard
USB
Mouse
USB
Internet Speed
920Mbs/480Mbs
Antivirus
Malwarebytes
Browser
Firefox
Without seeing the actual bat files it's impossible to know, and generally that's a part of Windows that hasn't changed a lot (if at all) in any recent and not so recent version.

First of all, what error messaage do you get?

My blind guess goes for an incorrect network name or something like that, very machine-specific that's not got changed.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Core i7-740QM8 GB DDR3NVIDIA GeForce 330GT
Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Back
Top