snowman533 Posted February 26, 2010 Share Posted February 26, 2010 (edited) title says it all how do i set a button to open a directory? and how do i stop the autorun menu from showing up without disabling autorun? i made a GUI which makes it easier for me to access the programs that i use the most on my USB device i want it to autorun but i dont want the default autorun menu to show up i only want my autorun menu to show up heres the code: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Autorun Menu", 233, 243, 192, 124) $Icon1 = GUICtrlCreateIcon("PasswordGenerator.exe", -1, 8, 8, 33, 33, BitOR($SS_NOTIFY, $WS_GROUP)) $Button1 = GUICtrlCreateButton("Password Generator", 48, 8, 177, 33, $WS_GROUP) $Icon2 = GUICtrlCreateIcon("PasswordGenerator.exe", -1, 8, 56, 33, 33, BitOR($SS_NOTIFY, $WS_GROUP)) $Button2 = GUICtrlCreateButton("Password Storer and finder", 48, 56, 177, 33, $WS_GROUP) $Icon3 = GUICtrlCreateIcon("CarryitEasy.exe", -1, 8, 104, 32, 32, BitOR($SS_NOTIFY, $WS_GROUP)) $Button3 = GUICtrlCreateButton("Synchronize your data", 48, 104, 177, 33, $WS_GROUP) $Button4 = GUICtrlCreateButton("Sort your files", 48, 152, 177, 33, $WS_GROUP) $Icon4 = GUICtrlCreateIcon("File sorter v2.1.exe", -1, 8, 152, 32, 32, BitOR($SS_NOTIFY, $WS_GROUP)) $Icon5 = GUICtrlCreateIcon("File sorter v2.1.exe", -1, 8, 200, 32, 32, BitOR($SS_NOTIFY, $WS_GROUP)) $Button5 = GUICtrlCreateButton("Misc Tools", 48, 200, 177, 33, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Run("PasswordGenerator.exe") Case $Button2 Run("passwordstorerfinder.exe") Case $Button3 Run("CarryitEasy.exe") Case $Button4 Run("File sorter v2.1.exe") Case $Button5 Run("Utils.exe") EndSwitch WEnd GUI works perfectly, i just want only that to show up when i plug the usb into my comp Edited February 26, 2010 by snowman533 Intermediate AutoIt/Autohotkey User Link to comment Share on other sites More sharing options...
BrettF Posted February 26, 2010 Share Posted February 26, 2010 Something like this may work, but keep in mind the security of the computer will affect its operation. Basically your USB won't disable the Autorun, windows will. ;Autorun.inf file [autorun] icon=_system\Icon.ico action="Open the MP3 Organizer" Open="MP3Organizer.exe" label="My MP3 player" UseAutoPlay=1 shellexecute="MP3Organizer.exe" Search the forums though. Other examples are in ample supply. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
snowman533 Posted March 2, 2010 Author Share Posted March 2, 2010 tx brett, how do i set a buton to open a directory? Intermediate AutoIt/Autohotkey User Link to comment Share on other sites More sharing options...
BrettF Posted March 2, 2010 Share Posted March 2, 2010 Run ("explorer.exe ""C:\Program Files\""") Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
snowman533 Posted March 2, 2010 Author Share Posted March 2, 2010 thanks Intermediate AutoIt/Autohotkey User Link to comment Share on other sites More sharing options...
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