MattX 0 Posted December 1, 2005 Share Posted December 1, 2005 I'll try and picture the situation for you. I have some laptops which all logon to a domain [2003]. When a user logs onto the laptop they will do so but will only have the choice of one ID. The reason for this is that the laptops logon to a wireless AP and because the profile is mandatry and some of the profile is re-directed to the laptop it can be quite large in size. So having different users logging on say for the first time takes a long time because the profile is being created on the users home drive and the laptop. So to speed things up I decided a user has to use the specific ID for that laptop. Now over this week with the aid of people on the forum I have knocked up a app which when a user triggers it, produces a combo box with a list of users in, they click on their ID, it then prompts them for their password and it then deletes the current n: drive and then maps their n: drive - [ so they can save data to their n: drive ] - now all goes well up until the vital part of mapping to their n: drive. The current n: drive is deleted and the script runs but then fails to map to their drive. There is no error, the script just ends but without mapping the drive. Now all I can think of is this is maybe a security aspect as the script is maybe still using the cached password from the laptop logon ? I thought though that stating the relevant user ID with the correct password in the DriveMapAdd would do but obviously not !! What I may try tomorrow is maybe a RunAsSet as either a local admin user or as the domain admin during the DriveMapAdd part to see if that will make a difference. What I am hoping though is that someone may have the answer or a possible reason why - Here is hoping !! And here is the script: expandcollapse popup; AutoIt Version: 3.1.1 ; Language: English ; Platform: WinXP ; Author: Matt ; Script Function: Script that Maps a drive to a users N: drive ; Version: #NoTrayIcon #include <GuiConstants.au3> GUICreate("Select User", 250, 66) $combo = GUICtrlCreateCombo("", 16, 8, 225, 21) GUICtrlSetData($combo, "") $selectbutton = GUICtrlCreateButton("Select", 100, 40, 60, 20) GUISetState() $userlist = IniReadSection("r:\matt\usersini.ini", "Users") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else For $i = 1 To $userlist[0][0] $tmp = $userlist[$i][1] & "|" GUICtrlSetData($combo, $tmp) Next EndIf While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $selectbutton $user = GUICtrlRead($combo) $password = InputBox("Security Check", "Enter your password.", "", "*") $drivemapuser = "\\server\" & $user DriveMapDel("n:") DriveMapAdd("n:", $drivemapuser, 8, $user, $password) Exit EndSelect WEnd Exit Link to post Share on other sites
GaryFrost 20 Posted December 2, 2005 Share Posted December 2, 2005 you might want to look at my DriveExplorer, has the code in it for mapping/unmapping drives with username/password http://www.autoitscript.com/forum/index.ph...ndpost&p=115483 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to post Share on other sites
MattX 0 Posted December 2, 2005 Author Share Posted December 2, 2005 Thanks I'll take a look, it would be nice to get my code working though !!I just stuck in a RunAsSet before the DriveMapAdd and it made no difference. Looks like my laptop is about to get chucked out of the window again...you might want to look at my DriveExplorer, has the code in it for mapping/unmapping drives with username/password http://www.autoitscript.com/forum/index.ph...ndpost&p=115483 Link to post Share on other sites
MattX 0 Posted December 2, 2005 Author Share Posted December 2, 2005 I've solved this by using the DNS name of the server instead of the netbios name - something to remember in the future !! Link to post Share on other sites
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