2

I'm questioning if it's possible to enable your wifi card/antennae/radio with a CMD command, like "wlan enable" or something?

I would like to do this so if someone forgot to turn on his wifi, this command enables it anyway.

I know it's possible to connect to a network but this is not what i'm looking for, besides that you have to know the name of the network. At best i'd like to avoid DevCon or third party software or something like that. Thanks in advance

2
  • I've created a batch file which sets up a hotspot, but it obviously wouldn't work if someone doesn't have his wifi enabled. With this step i'd try to avoid that error. – Bart May 9 '14 at 13:42
  • 2
    If they have flipped the switch and turned off the hardware this means software cannot enable it. It still has to be turned on, might not be connected, but be turned on. – Ramhound May 9 '14 at 13:54
4

There is a Microsoft scripting blog post that answers this question several ways.

You can do it via WSH with the helper exe you mentioned in the question or PowerShell using WMI or natively on Windows 8.

The helper exe is called Devcon.

The WMI/PowerShell method uses the Win32 NetworkAdapter Class.

There is a 3rd method if you are using Windows 8+, the NetAdaptor PowerShell module.

Note though that some if not all of these methods requires admin rights.

3
  • Thanks for your help but those methods seems somewhat too difficult for me... at least, the ones that don't include third-party software. I began with batch programming yesterday so you could say i don't have really much experience with it... I am somewhat experienced in HTML, PHP etc. so i know a few things about programming. – Bart May 9 '14 at 13:47
  • 1
    I think that, if you just follow the examples given and change the names of the adapters you will find it works. It isn't that much harder to do PowerShell than batch certainly no real harder than PHP. If you've ever used PHP to interact with the servers hardware (OS, file system, etc.), you already have many of the basic ideas. PowerShell is batch on steroids you might say. Anyway, if you don't want to use a helper app, you've not much choice. Actually, you could call WMI from PHP come to think of it! – Julian Knight May 9 '14 at 13:51
  • 1
    @user3029361 - You said you wanted to avoid third-party software. – Ramhound May 9 '14 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.