Problem mapping network shares at startup
Hello, Platform: HP Notebook running Windows Vista Home Edition in a wireless LAN. Problem description: When Vista starts, it should automatically map two network shares from two distinct servers. However, it always fails to do so as it seems the mapping during the startup process is taking place before the wireless card has had enough time to successfully associate with the access point. In other words, the mapping is attempted before the network link is brought up. It occurs to me Vista is mis-handling this synching issue.Of course, both shares can be successfully mapped manually after the startup process completes and the wireless card has had enough time to associate with the Access Point. Needsless to say, this doesn't happen to the wired workstations. My question then is, what do I have to tweak in Vista's configuration so as to allow interdependent services to come up in the proper order to avoid situations likethe one described above? Thank you.Fernando
January 25th, 2008 1:06am

Hi Fernando, Thank you for the post. Based on my experience, there is no specific service indicating the wireless network is ready. For a workaround, you may use script to address the requirement. I suggest contacting our MSDN support. The support professionals there are better equipped to assist you. For your reference, Ive included the link of MSDN Forum: MSDN Forumhttp://forums.microsoft.com/msdn/default.aspx?siteid=1 In addition, here is an example for your reference: 1. On the Windows Vista machine, please disconnect the existing network drives. 2. Open notepad, copy the following content to it:========================================================= When you logon the Windows Vista machine, it will ping the server.If ping succeeds, it will map the network drives by using net use command. If not, it will wait for 5 seconds, and try to ping again. When the user logoff, the network drives will be deleted automatically. Option Explicit Dim strHost ' Check that all arguments required have been passed. 'If Wscript.Arguments.Count < 1 Then ' Wscript.Echo "Arguments <Host> required. For example:" & vbCrLf _ ' & "cscript vbping.vbs savdaldc01" ' Wscript.Quit(0) 'End If 'strHost = Wscript.Arguments(0) strHost= "192.168.3.1" It is the IP address of the server, please change the parameter with the environment While Ping(strHost) = False ' Wscript.Echo "Host " & strHost & " could not be contacted" Dim WshShell set WshShell = WScript.CreateObject("WScript.Shell") WScript.Sleep 5000 Ping(strHost) Wend If ping(strHost) = True Then Dim oShell Set oShell = WScript.CreateObject ("WSCript.shell") oShell.run "cmd /K net use Z: \\192.168.3.1\share /user:aa <password> /PERSISTENT:no" map network drives by using the net use command, please change the parameter according to the environment Set oShell = Nothing ' Wscript.Echo "Host " & strHost & " contacted" End If Function Ping(strHost) dim objPing, objRetStatus set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _ ("select * from Win32_PingStatus where address = '" & strHost & "'") for each objRetStatus in objPing if IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then Ping = False 'WScript.Echo "Status code is " & objRetStatus.StatusCode else Ping = True 'Wscript.Echo "Bytes = " & vbTab & objRetStatus.BufferSize 'Wscript.Echo "Time (ms) = " & vbTab & objRetStatus.ResponseTime 'Wscript.Echo "TTL (s) = " & vbTab & objRetStatus.ResponseTimeToLive end if next End Function =============================== 3. Save this file in the Startup folder (%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup), and rename it to a .vbs file. Sorry, I am not a scripting guy. You may contact our MSDN support to optimize the script. Hope it helps. Sincerely, Joson Zhou Microsoft Online Community Support
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2008 12:52pm

Thanks Joson ! The script did the trick. Fernando
February 5th, 2008 12:05am

Joson, I am a Windows XP Professional user who has a similar question here. I am also trying to connect a wireless computer to mapped network drives, but when I sign into windows, it requires that I put in the password when I attempt to access the networked drives. I dont' have this problem on my wired ethernet computers, because I run a simple "net use" script for them when those computers start up (I put the .bat scripts in the startup folder). However, that does not work for wireless computers, because the script runs before the wireless card connects to the access point. I tried to copy and paste your software into a .txt file (which I later converted to .bat). I changed the IP address of strHost to "192.168.1.101", which is the IP of the Network Attached Storage device, and where the mapped drives are located. I included the quotation marks in the .txt file as well. I also made the changes to the net use: file. However, when I run the program as a .bat, it tells me that there are errors. It says things like: "Dim" is not recognized as an internal or external command, operatable program or batch file. it also says that "'If Wscript.Arguments.Count Then 0<1" - the system cannot find the file specified. It does this for pretty much every command in the script. When I try and change it to a .vbs file, it won't even run, it will just come up and say there was an error on line 1. I copied and pasted the program exactly as it appears in your answer, except I changed the IP address of strHost, and I changed the net use to reflect the correct usernames and passwords. Do you know what the problem might be here? Thanks for your help. - Kpish
Free Windows Admin Tool Kit Click here and download it now
February 5th, 2008 3:59am

kpish,I belive you are trying to run this script as a .bat file. However, the script outlined by Jozon is a visual basic script (vbs) and needs to be saved as a .vbs file.
February 24th, 2009 4:55pm

Hi Joson,I also have this problem.Network Attached Storage Devices are now commonplace and many people use them for providing extra storage on their wireless networks, in fact the number of network hard drives has multiplied in recent years specifically to fill the demand for additional storage space for laptop users (who may otherwise be constrained by the limited hard drive space within their devices). I also expect this demand for network attached hard drives to multiply over the next few years as netbooks become more common.I have personally tried for almost 6 months to identify a solution to combat the 'network could not connect error' by creating (batch file) .bat scripts (using pings to add delay to allow the wireless network to connect first).I will try yourvisual basicscript tonight (.vbs), hopefully it will work.However; it is annoying that Microsoft has not released an update via a Service Pack to remedy this very common annoyance to many people. Most users would not be technical enough to implement this 'hack' to get their Network Attached Storage to work correctly without a spurious error message.Thanks,Michael
Free Windows Admin Tool Kit Click here and download it now
February 24th, 2009 5:06pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics