khsh Posted June 8, 2004 Share Posted June 8, 2004 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! Link to comment Share on other sites More sharing options...
rdalling Posted June 8, 2004 Share Posted June 8, 2004 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 Link to comment Share on other sites More sharing options...
likuidkewl Posted June 8, 2004 Share Posted June 8, 2004 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 Link to comment Share on other sites More sharing options...
khsh Posted June 8, 2004 Author Share Posted June 8, 2004 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. Link to comment Share on other sites More sharing options...
rdalling Posted June 9, 2004 Share Posted June 9, 2004 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 Link to comment Share on other sites More sharing options...
likuidkewl Posted June 9, 2004 Share Posted June 9, 2004 Might want to try this page:http://communities.microsoft.com/newsgroup...s.oem.windowsxp Link to comment Share on other sites More sharing options...
khsh Posted June 9, 2004 Author Share Posted June 9, 2004 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!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now