dcaston Posted February 5, 2007 Posted February 5, 2007 Hi all, I am getting an error 3775 with the new winpe 2.0, the user context supplied is in valid, help please?Thanks,
johnhlaj Posted February 11, 2007 Posted February 11, 2007 I have been using a windows scripting host script and it seems to work. Here is the code I have been using for this:paste this into notepad and rename it to map.vbs or whatever you want. It should do the trick.For my needs I have it clearing all network connections each time it runs and mapping one drive to Zit works for what I need.'Map a network drive of your choice'Created by John Hlaj'Jan 28, 2007Option ExplicitDim objNetwork Dim i, clDrives, WSHNetwork, strDriveLetter, strRemotePath ,strUserName, strPassword , strProfile'Disconnect ALL mapped drivesSet WSHNetwork = CreateObject("WScript.Network")Set clDrives = WshNetwork.EnumNetworkDrivesFor i = 0 to clDrives.Count -1 Step 2WSHNetwork.RemoveNetworkDrive clDrives.Item(i), True, TrueNext'Give the PC time to do the disconnect, wait 300 millisecondswscript.sleep 300'Set drive to Z and request remote pathstrDriveLetter = "Z:" strRemotePath = InputBox("Enter remote path eg. \\server\share", "Map Network Drive by John Hlaj")if IsEmpty(strRemotePath) then Wscript.Quitend ifstrUserName = InputBox("Enter user name.", "Map Network Drive by John Hlaj")if IsEmpty(strUserName) then Wscript.Quitend ifstrPassword = InputBox("Enter password.", "Map Network Drive by John Hlaj")if IsEmpty(strPassword) then Wscript.Quitend ifstrProfile = "false"' Creates a network object' Then to apply the MapNetworkDrive method.Set objNetwork = CreateObject("WScript.Network") objNetwork.MapNetworkDrive strDriveLetter, strRemotePath , strProfile, strUserName, strPassword' Extra code just to add a message boxWScript.Echo strRemotePath & " mapped to: " & strDriveLetter WScript.Quit
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