• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 863
  • Last Modified:

script add wireless network XP

Hello,

I need a vbscript that will add a wireless network with psk in Windows XP SP2 and/or SP3.  I've been unable to find a viable and reliable solution thus far.  Here's what I've used so far, it works sometimes but I need a more reliable solution like netsh wlan for Windows 7.

SSID="SSIDName" 
Key="PSK" 
 
Dim objShell:Set objShell=CreateObject("Wscript.Shell")
 
With objShell
  .Run "control netsetup.cpl"
  wscript.sleep 100000
  .AppActivate "Wireless Network Setup Wizard"
  .SendKeys "%NSN" & SSID & "%M" & "{TAB}" & " n"
  .SendKeys "%W" & Key
  .SendKeys "%O" & Key
  .SendKeys "%NSN+{Tab}~"
End With
 
Set objShell=Nothing

Open in new window

0
crash1624
Asked:
crash1624
  • 3
  • 2
1 Solution
 
Arman KhodabandeCommented:
Hi
This would do the job : http://code.mincus.com/31/windows-wireless-api/

Work on it and make your script based upon it.
0
 
crash1624Author Commented:
I appreciate the input but I need an option that does not require installation of third party software.  I have hundreds of XP based machines to push this out to.  There has to be a suitable option built into the OS like netsh wlan for Vista/7.
0
 
Arman KhodabandeCommented:
Your own script is the best method!
I don't think that you find it in XP!
Or at least I can't come up with a better solution. We'll wait for other experts to answer.
Good luck
0
 
crash1624Author Commented:
I agree, I don't see a better solution for XP.  Thanks for the input though.
0
 
Arman KhodabandeCommented:
If you want to refine your script to work most of the time just increase the timing in case of a delay. However your timings are good and long enough to make it work!
"I've been unable to find a viable and reliable solution" >> Your script is reliable already! But I know that you looked for a real script not a physical way like this!
Using that 3rd party utility is good and reliable too.
Anyway depends on your choice . . .
Good luck
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now