June 8, 200422 yr hello, new user here. i am using windows pe to boot up a client and map a couple of drives back to a server. my winpe is configured to execute startnet.cmd with the following commands.factory -winpenet use f: "\\server\\share" mypassword /USER:usernamei'm using dhcp specified in my [winpe.net] section of winbom.iniwhen executing the net use command fails with system error 1231 (The network location cannot be reached). however, after failing if i simply type in by hand "net use f: "\\server\\share" mypassword /USER:username" it maps the drive just fine. it only fails when trying to execute it from the script. has anyone else seen this behavior or possibly knows of a solution to get the command to work from a script?thanks!
June 8, 200422 yr What is happening is the network stack has not completly initialized.What I had to do to get past it was issue a network command to initialze the stack and then issue a net use command.Roger
June 8, 200422 yr Sounds like the network is not fully loading before you are trying to map it add the "wait" switch to it.i.e. START /WAIT "Mapping Network Drives" mapdrives.bat
June 8, 200422 yr Author roger, do you recall what network command you used? it appears that the list of commands that net.exe (xp version) understands is somewhat limited. i can't see any "net initialize" like we have in dos. also, i did try the start /wait suggestion but that didn't seem to work either. it's as though the process hangs and won't finish initializing the stack until the user has interuptted the shell window in some way.
June 9, 200422 yr To initialze the stack I tried several things until it started working, I ran the net view command and then mapped my driveI added a ping command to the startnetbasically anything to get the network to talk TCP/IPR
June 9, 200422 yr Might want to try this page:http://communities.microsoft.com/newsgroup...s.oem.windowsxp
June 9, 200422 yr Author problem solved. created an executable file that logs me on to the remote machine before mapping the drives. the exe calls the Microsoft Networking API "WNetAddConnection2" inside a while loop that continually tries to connect until it hits a timeout value or successfully connects. thanks for all of your input!!
Create an account or sign in to comment