Jump to content

Mapping To Drive GUI?


lyonrt
 Share

Recommended Posts

I am trying to get my GUI program to allow a user to map to a drive. The user on the network already has a username and password and its all he or she needs to enter in this program. After it is entered, I am trying to get the program to use the entered data to map to a drive as well as add "bc\" in front of the username so that it looks like this: "bc\usernamegoeshere" and the password in the password field below that. The drive that needs to be connected to is (also includes a dollar sign): \\phoenix\usernamegoeshere$

Please help. I attached the code and a screenshot.

-Thanks,

Tyler

#include <GuiConstants.au3>
#include <inet.au3>

GuiCreate("ResNet CD", 500, 600)


;************************************MENU***********************************************************

**
$filemenu = GuiCtrlCreateMenu("File")
$separator1 = GuiCtrlCreateMenuitem ("", $filemenu)
$fileitem = GuiCtrlCreateMenuitem ("Exit",$filemenu)

GuiCtrlCreateMenu("Options")

$helpmenu = GuiCtrlCreateMenu("Help")
$helpitem = GuiCtrlCreateMenuitem ("About",$helpmenu)

;************************************LABEL TOP*************************************************************
$Label = GUICtrlCreateLabel("Choose from the items below.",10,10)





;************************************ANTIVIRUS GROUP*************************************************************
GuiCtrlCreateGroup("Step 1 - Remove Virus(s)", 10, 30,260,100)
$STINGER = GUICtrlCreateButton("Run Stinger", 30, 50, 100, 50)
$AVG = GUICtrlCreateButton("Install AVG", 150, 50, 100, 50)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group




;************************************SPYWARE GROUP*************************************************************

GuiCtrlCreateGroup("Step 2 - Remove Spyware & Datamine(s)", 10, 150,260,100)
$SPYBOT = GUICtrlCreateButton("SpyBot Update or Install", 70,180,130,50)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group





;************************************OTHER APPS AND UPDATES*************************************************************

GuiCtrlCreateGroup("Step 3 - Misceleaneaous", 10, 270,260,100)
$SP2 = GUICtrlCreateButton("Service Pack 2", 30,300,100,50)
$ADAWARE = GUICtrlCreateButton("Adaware", 150, 300, 100, 50)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group


;************************************WINDOWS UPDATE*************************************************************

GuiCtrlCreateGroup("Step 4 - Windows Update", 10, 390,260,70)
$www = GUICtrlCreateLabel ("www.windowsupdate.com",30,419,140,15)
GuiCtrlSetColor($www,0x0000ff)
GuiCtrlSetCursor($www,0)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group


;************************************SYSTEM INFO*************************************************************
; GROUP: INPUT IP,ComputerName, MAC

GuiCtrlCreateGroup("System Info", 10, 482,480,70)

$LabelIP = GUICtrlCreateLabel("IP: " , 20, 500)
$PublicIP = @IPAddress1
GuiCtrlCreateInput(@IPAddress1, 40, 498, 95, 20)

$PublicNAME = @ComputerName

$LabelName = GUICtrlCreateLabel("Computer: ",140,500)
$PublicNAME = @ComputerName
GUICtrlCreateInput(@ComputerName,190,498,100,20)


$Warning = GUICtrlCreateLabel("***By Clicking On This Button You Agree That You Have Completed All Certification Steps*** ",20,530)
GuiCtrlSetColor($Warning,0x0000ff)

$MapDrive = GUICtrlCreateButton("Certify Me", 300,497,60,25)

GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

;************************************RIGHT INFO PANEL*************************************************************

GuiCtrlCreateGroup("Please Follow Directions", 300, 10,190,320)




GUICtrlCreateGroup ("",-99,-99,1,1) ;close group


;************************************Right Student Drive Mapper*************************************************************
GuiCtrlCreateGroup("Map To Your Student Drive", 300, 340,190,140)

$Labellogin = GUICtrlCreateLabel("Username:",320,375)
$inputlogin= GUICtrlCreateInput("username",380,372,90,20)

$Labelpass = GUICtrlCreateLabel("Password:",320,415)
$inputlogin = GUICtrlCreateInput("********",380,412,90,20)

$MapDrive = GUICtrlCreateButton("Map Drive", 380,440,60,25)


GUICtrlCreateGroup ("",-99,-99,1,1) ;close group


;************************************FOOTER*********************************************************

****
$Labelfooter = GUICtrlCreateLabel("Created By Robert Tyler Lyon (c)2006  All Rights Reserved.",100,560)




GUISetState() ; display the GUI

Do
    $msg = GUIGetMsg()
   
    Select
;************************************ABOUT BOX*************************************************************
;File Menu Below        
        Case $msg = $helpitem
            Msgbox(0,"About","Robert Tyler Lyon")

;************************************MENU FUNCTIONS*************************************************************
        
        Case $msg= $fileitem
            Exit

;************************************BUTTON FUNCTIONS*************************************************************

        Case $msg= $AVG
             Run("avg71free_375a691.exe")
        Case $msg= $STINGER
            Run("stinger_run.exe")
        Case $msg= $SPYBOT
            Run("Spybot_Install_or_run.exe")
        Case $msg= $SP2
            Run("WindowsXP-KB835935-SP2-ENU.exe")
        Case $msg= $ADAWARE
            Run("aawsepersonal.exe")
        
        Case $msg= $www
            Run(@ComSpec & " /c " & 'start www.windowsupdate.com', "", @SW_HIDE)


        
        Case $msg= $GUI_EVENT_CLOSE


            
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

Posted Image

Link to comment
Share on other sites

I am trying to get my GUI program to allow a user to map to a drive. The user on the network already has a username and password and its all he or she needs to enter in this program. After it is entered, I am trying to get the program to use the entered data to map to a drive as well as add "bc\" in front of the username so that it looks like this: "bc\usernamegoeshere" and the password in the password field below that. The drive that needs to be connected to is (also includes a dollar sign): \\phoenix\usernamegoeshere$

Please help. I attached the code and a screenshot.

-Thanks,

Tyler

#include <GuiConstants.au3>
#include <inet.au3>

GuiCreate("ResNet CD", 500, 600)
;************************************MENU***********************************************************

**
$filemenu = GuiCtrlCreateMenu("File")
$separator1 = GuiCtrlCreateMenuitem ("", $filemenu)
$fileitem = GuiCtrlCreateMenuitem ("Exit",$filemenu)

GuiCtrlCreateMenu("Options")

$helpmenu = GuiCtrlCreateMenu("Help")
$helpitem = GuiCtrlCreateMenuitem ("About",$helpmenu)

;************************************LABEL TOP*************************************************************
$Label = GUICtrlCreateLabel("Choose from the items below.",10,10)
;************************************ANTIVIRUS GROUP*************************************************************
GuiCtrlCreateGroup("Step 1 - Remove Virus(s)", 10, 30,260,100)
$STINGER = GUICtrlCreateButton("Run Stinger", 30, 50, 100, 50)
$AVG = GUICtrlCreateButton("Install AVG", 150, 50, 100, 50)
GUICtrlCreateGroup ("",-99,-99,1,1);close group
;************************************SPYWARE GROUP*************************************************************

GuiCtrlCreateGroup("Step 2 - Remove Spyware & Datamine(s)", 10, 150,260,100)
$SPYBOT = GUICtrlCreateButton("SpyBot Update or Install", 70,180,130,50)
GUICtrlCreateGroup ("",-99,-99,1,1);close group
;************************************OTHER APPS AND UPDATES*************************************************************

GuiCtrlCreateGroup("Step 3 - Misceleaneaous", 10, 270,260,100)
$SP2 = GUICtrlCreateButton("Service Pack 2", 30,300,100,50)
$ADAWARE = GUICtrlCreateButton("Adaware", 150, 300, 100, 50)
GUICtrlCreateGroup ("",-99,-99,1,1);close group
;************************************WINDOWS UPDATE*************************************************************

GuiCtrlCreateGroup("Step 4 - Windows Update", 10, 390,260,70)
$www = GUICtrlCreateLabel ("www.windowsupdate.com",30,419,140,15)
GuiCtrlSetColor($www,0x0000ff)
GuiCtrlSetCursor($www,0)
GUICtrlCreateGroup ("",-99,-99,1,1);close group
;************************************SYSTEM INFO*************************************************************
; GROUP: INPUT IP,ComputerName, MAC

GuiCtrlCreateGroup("System Info", 10, 482,480,70)

$LabelIP = GUICtrlCreateLabel("IP: " , 20, 500)
$PublicIP = @IPAddress1
GuiCtrlCreateInput(@IPAddress1, 40, 498, 95, 20)

$PublicNAME = @ComputerName

$LabelName = GUICtrlCreateLabel("Computer: ",140,500)
$PublicNAME = @ComputerName
GUICtrlCreateInput(@ComputerName,190,498,100,20)
$Warning = GUICtrlCreateLabel("***By Clicking On This Button You Agree That You Have Completed All Certification Steps*** ",20,530)
GuiCtrlSetColor($Warning,0x0000ff)

$MapDrive = GUICtrlCreateButton("Certify Me", 300,497,60,25)

GUICtrlCreateGroup ("",-99,-99,1,1);close group

;************************************RIGHT INFO PANEL*************************************************************

GuiCtrlCreateGroup("Please Follow Directions", 300, 10,190,320)
GUICtrlCreateGroup ("",-99,-99,1,1);close group
;************************************Right Student Drive Mapper*************************************************************
GuiCtrlCreateGroup("Map To Your Student Drive", 300, 340,190,140)

$Labellogin = GUICtrlCreateLabel("Username:",320,375)
$inputlogin= GUICtrlCreateInput("username",380,372,90,20)

$Labelpass = GUICtrlCreateLabel("Password:",320,415)
$inputlogin = GUICtrlCreateInput("********",380,412,90,20)

$MapDrive = GUICtrlCreateButton("Map Drive", 380,440,60,25)
GUICtrlCreateGroup ("",-99,-99,1,1);close group
;************************************FOOTER*********************************************************

****
$Labelfooter = GUICtrlCreateLabel("Created By Robert Tyler Lyon (c)2006  All Rights Reserved.",100,560)
GUISetState(); display the GUI

Do
    $msg = GUIGetMsg()
   
    Select
;************************************ABOUT BOX*************************************************************
;File Menu Below        
        Case $msg = $helpitem
            Msgbox(0,"About","Robert Tyler Lyon")

;************************************MENU FUNCTIONS*************************************************************
        
        Case $msg= $fileitem
            Exit

;************************************BUTTON FUNCTIONS*************************************************************

        Case $msg= $AVG
             Run("avg71free_375a691.exe")
        Case $msg= $STINGER
            Run("stinger_run.exe")
        Case $msg= $SPYBOT
            Run("Spybot_Install_or_run.exe")
        Case $msg= $SP2
            Run("WindowsXP-KB835935-SP2-ENU.exe")
        Case $msg= $ADAWARE
            Run("aawsepersonal.exe")
        
        Case $msg= $www
            Run(@ComSpec & " /c " & 'start www.windowsupdate.com', "", @SW_HIDE)
        
        Case $msg= $GUI_EVENT_CLOSE
            
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

Posted Image

hey man, welcome to the forums. so you know, this forum isn't the support forum, so you may not get the kind of answers you're looking for. if you go back to the forum homepage, you'll see two forums at th e top are v3 support, and v3 gui. you can probably get an answer for this in either of those, i'd post it myself, but not seeeing very straight just yet. if it's still up in the mornign i'll try my hand.
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...