[AutoIt v3]Detecting Drive Letter menu

User Tag List

Results 1 to 3 of 3
  1. #1
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [AutoIt v3]Detecting Drive Letter

    Okay,

    So what i am trying to do is make a splash screen for my USB Flash drive.

    I worked out the program, but what i am attempting to do now is make it so when the splash screen dissappears the drive opens w/ Windows explorer.

    The only problem is the drive letter is different of all computers so i am trying to get the script to detect what letter my drive is, then open it.

    Here is the .au3 i wrote:

    Code:
    ;Autorun Splash Screen
     
    Dim $ConfigFile ;Configuration File
    Dim $ImageFile ;Image to be shown.  Must be BMP,GIF or JPG
    Dim $ImageWidth ;Width of the image to display in pixels
    Dim $ImageHeight ;Height of image in pixels
    Dim $Title ;Title to be displayed
    Dim $ShowTime ;Length of time to display image in seconds
    Dim $ShowTitle ;Determine whether or not to display the title
    Dim $ShowTitleSetting ;Setting for ShowTitle
     
    $ConfigFile = _GetConfigFile("autosplash.ini",True)
     
    If $ConfigFile = "Error" Then Exit
     
    $ImageFile = IniRead($ConfigFile,"General","ImageFile","SplashImage.jpg")
     
    If StringMid($ImageFile,2,1)<>":" and StringMid($ImageFile,2,1)<>"\" Then
        $ImageFile = @ScriptDir & "\" & $ImageFile
    EndIf
     
    If Not FileExists($ImageFile) Then Exit
     
    $ImageHeight = IniRead($ConfigFile,"General","ImageHeight",68)
    $ImageWidth = IniRead($ConfigFile,"General","ImageWidth",587)
    $Title = IniRead($ConfigFile,"General","Title","Daily Cup of Tech")
    $ShowTime = IniRead($ConfigFile,"General","ShowTime",2)
    $ShowTitle = IniRead($ConfigFile,"General","ShowTitle",False)
     
    If $ShowTitle = True Then
        $ShowTitleSetting = -1
    Else
        $ShowTitleSetting = 1
    EndIf
     
     
    SplashImageOn($Title,$ImageFile,$ImageWidth,$ImageHeight,-1,-1,$ShowTitleSetting)
    Sleep($ShowTime * 1000)
    Code:
    ShellExecute("explorer.exe","I:\")
    ShellExecute("explorer.exe","G:\")
    SplashOff()
     
    #region Functions
    Func _GetConfigFile($filename,$silent = False)
        Local $configfilename
        $configfilename = @ScriptDir & "\" & $filename
     
        If Not FileExists($configfilename) Then
            If Not $silent Then
                MsgBox(16,"File Missing","The file " & $filename & " is not available." & @CRLF & "Please ensure that it is located in the " & @ScriptDir & " directory." & @CRLF & "The application will now exit.")
                Exit
            EndIf
            SetError(1)
            Return "Error"
        EndIf
        Return $configfilename
    EndFunc
    #endregion
    


    On my desktop it is drive I:\ and on my laptop it is drive G:\.

    Any help is appreciated & +Rep - ed



    [AutoIt v3]Detecting Drive Letter
  2. #2
    Thidan's Avatar Contributor
    Reputation
    299
    Join Date
    Jan 2007
    Posts
    1,009
    Thanks G/R
    2/15
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $usb = DriveGetDrive("Removable")
    Would be my solution.

    Lookup: DriveGetDrive in the 'Help'-file.


  3. #3
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx man this is exactly what i needed!

    +Rep

    Sorriez i havent been on. Computer issues XD gettin' a new on in April tho

Similar Threads

  1. autoit bots process detection
    By geek15 in forum Diablo 3 Bots Questions & Requests
    Replies: 2
    Last Post: 03-21-2013, 01:58 AM
  2. [Concept] Motion detection with autoit
    By PragmaThrice in forum Diablo 3 Bots and Programs
    Replies: 1
    Last Post: 06-19-2012, 11:30 PM
  3. AutoIT detectable?
    By ALWIN21 in forum Diablo 3 Bots Questions & Requests
    Replies: 2
    Last Post: 06-18-2012, 08:16 PM
  4. Is AutoIt Detectable/Bannable
    By Kandahar in forum WoW Bots Questions & Requests
    Replies: 5
    Last Post: 10-10-2010, 12:40 AM
  5. How detectable is autoit?
    By Adrolak2 in forum World of Warcraft General
    Replies: 4
    Last Post: 12-17-2008, 02:55 PM
All times are GMT -5. The time now is 04:17 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search