Jump to content

help GuiCtrlCreateInput for drivemaping


Recommended Posts

I am trying to map network drives using user input each student at this college has a share called \\bigdrive\username username being the user name we assign them I want the student to be able to input their username and password and map the drives can anyone help me I am still learning and stumped on this I remmed out the drive map lines because they do not work I started with net use then saw that there was an autoit drive map command Please help frustrated

#include <GUIConstants.au3>

$ParentWin = GUICreate(" Drive Mapping Wizard",450,200)

$filemenu = GuiCtrlCreateMenu ("File")

$exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu)

$helpmenu = GuiCtrlCreateMenu ("?")

$aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu)

; PIC

GuiCtrlCreatePic("logo.gif",428, 0, 162,20)

;Top message

GUICtrlCreateLabel("Enter your Username", 50,50,150,20)

GUICtrlCreateLabel("Enter your Password",250, 50, 150 ,20)

$username = GuiCtrlCreateInput("", 50,80,150,20)

$password = GuiCtrlCreateInput("",250, 80, 150 ,20 ,$ES_PASSWORD)

;First row of buttons

$Mapbutton = GuiCtrlCreateButton (" Map my P Drive",50,150,200,20)

$cancelbutton = GuiCtrlCreateButton (" Cancel",300,150,100,20)

GuiSetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Cancelbutton Or $msg = $ExitItem Or$msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $Mapbutton

;$pwl = GUICtrlRead($password)

;$usr = GUICtrlRead($username)

;("net use j: \\bigstore1\%1 /USER:colby\$username $password /persistent:yes")

; ("net use j: \\bigdrive\courseware /USER:colbys\$username $password /persistent:yes")

;DriveMapAdd("j:", "\\bigdrive\& $username" , 1, " $username" , " $password")

;DriveMapAdd("k:", "\\bigdrive\classmaterial" , 1, " $username" , " $password")

DriveMapAdd("k:", "\\bigdrive\courseware")

Case $msg = $Mapbutton

Run (

Case $msg = $aboutitem

MsgBox(0,"About","Colby-Sawyer Drive Mapping Wizard")

EndSelect

WEnd

GUIDelete()

Exit

Link to comment
Share on other sites

the syntax is incorrect

what you currently have commented out

;DriveMapAdd("l:", "\\bigdrive\& $username" , 1, " $username" , " $password")

try this

DriveMapAdd("l:", "\\bigdrive\" & $username , 1, "domain name\" & $username , $password)

i believe you also need the domain name with the username

Edited by gafrost

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 comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...