Avatar of crash1624
crash1624

asked on 

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

Wireless NetworkingWindows XPVB Script

Avatar of undefined
Last Comment
Arman Khodabande
Avatar of Arman Khodabande
Arman Khodabande
Flag of Iran, Islamic Republic of image

Hi
This would do the job : http://code.mincus.com/31/windows-wireless-api/

Work on it and make your script based upon it.
Avatar of crash1624
crash1624

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Arman Khodabande
Arman Khodabande
Flag of Iran, Islamic Republic of image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of crash1624
crash1624

ASKER

I agree, I don't see a better solution for XP.  Thanks for the input though.
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
Windows XP
Windows XP

Microsoft Windows XP is the sixth release of the NT series of operating systems, and was the first to be marketed in a variety of editions: XP Home and XP Professional, designed for business and power users. The advanced features in XP Professional are generally disabled in Home Edition, but are there and can be activated. There were two 64-bit editions, an embedded edition and a tablet edition.

119K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo