Mark Minasi's Reader Forum
Mark Minasi's Reader Forum
Home | Profile | Register | Active Topics | Active Polls | Members | Search | FAQ | Minasi Forum RSS Feed
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 HALP! Questions on Windows and Windows Server
 Windows 7 Desktop
 Win7: Create Wireless Profile from Command line
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chad_work2001
Seasoned But Casual Onlooker

USA
34 Posts
Status: offline

Posted - 06/01/2012 :  5:01:25 PM  Show Profile  Reply with Quote
Background:
The NETSH command allows one to manage wireless profiles but does anyone know if it allows one to CREATE wireless profiles?

I can create a wireless profile manually through the GUI on a reference computer, and then export it to an .XML file, which I can then use with the NETSH command to configure that network profile on any other system I want, but that's not what I want to do.


Problem: In Windows 7, I want to use the command line in place of the GUI to CREATE a wireless profile. How do I do that?

Thanks,
-Chad

jaxdave
Honorable But Hopeless Addict

USA
2426 Posts
Status: offline

Posted - 06/04/2012 :  3:44:04 PM  Show Profile  Reply with Quote
This article might have what you are looking for....

http://answers.oreilly.com/topic/1180-how-to-configure-wireless-settings-in-windows-7/

cheers,
Dave
Go to Top of Page

JeffWouters
Here To Stay

Netherlands
147 Posts
Status: offline

Posted - 06/04/2012 :  4:36:47 PM  Show Profile  Visit JeffWouters's Homepage  Click to see JeffWouters's MSN Messenger address  Look at the Skype address for JeffWouters  Reply with Quote
Don't know where I got this from (and please forgive me for providing VB instead of PowerShell) but maybe this can help you:

strComputer = "."
Set objWMIService2 = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService2.ExecQuery _
("Select * from Win32_NetworkAdapter")

wirelessfound=False

For Each objAdapter in colAdapters
'msgbox wscript.echo objAdapter.Name & " " & objAdapter.Description & " " & objAdapter.NetConnectionID
if (instr(lcase(objAdapter.Name & objAdapter.Description & objAdapter.NetConnectionID), "wireless") or _
instr(lcase(objAdapter.Name & objAdapter.Description & objAdapter.NetConnectionID), "wlan") or _
instr(lcase(objAdapter.Name & objAdapter.Description & objAdapter.NetConnectionID), "weth0") or _
instr(lcase(objAdapter.Name & objAdapter.Description & objAdapter.NetConnectionID), "802.11")) then

debugecho "Wireless Found: " & objAdapter.Name
wirelessfound = true
exit for
end if
Next

If (wirelessfound) Then
If GetOSVersion = "6.1.7600" Then
wshshell.Run "cmd /c REG.EXE ADD ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"" /v ""C:\Temp\wireless\zwlancfg.exe"" /t REG_SZ /d ""VISTASP2"" /f", 0, 1
wshshell.Run "cmd /c REG.EXE ADD ""HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"" /v ""C:\Temp\wireless\zwlancfg.exe"" /t REG_SZ /d ""VISTASP2"" /f", 0, 1
WScript.Sleep 2000
End If
wshshell.Run "cmd /c path\to\zwlancfg.exe /ssid:""SSID"" /ct:""ESS"" /mode:""auto"" /auth:""WPA2PSK"" /encrypt:""TKIP"" /keytype:""passPhrase"" /key:"""&encryptedkey&""""
End If

Function GetOSVersion
Dim System
for each System in GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
GetOSVersion = System.Version
Next
End Function

Greetsz,
Jeff.
Go to Top of Page

chad_work2001
Seasoned But Casual Onlooker

USA
34 Posts
Status: offline

Posted - 06/04/2012 :  4:46:06 PM  Show Profile  Reply with Quote
Thanks JaxDave.

The procedure you linked is configuring the profile through the GUI first, and then manipulating it through the command line later.

I'm looking for a way to create the profile through the command line instead of the GUI.

Thanks,
-Chad
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Mark Minasi's Reader Forum © 2002-2011 Mark Minasi Go To Top Of Page
This page was generated in 0.12 seconds. Snitz Forums 2000