How to open folders?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Vaz
    Forum Member
    • Feb 2007
    • 5

    How to open folders?

    Hi,

    I'm trying to create a button to open a folder on my d:\

    such as d:\program1

    I can't seem to do it. I tried the explore function but that doesnt seem to be it.

    Thanks
  • ianhull
    Forum Member
    • Jul 2004
    • 314

    #2
    result = Dialog.FolderBrowse("Please select a folder:", "d:\program1");

    Comment

    • Vaz
      Forum Member
      • Feb 2007
      • 5

      #3
      Hi ianhull,

      That code bring's up the following dialogue:



      As apposed to the correct folder open infront of you.

      Comment

      • fossil
        Forum Member
        • Oct 2005
        • 24

        #4
        Try this :

        File.Open("D:\\program1", "", SW_SHOWNORMAL);

        Comment

        • el5ateer
          Forum Member
          • Jul 2005
          • 88

          #5
          Check this one as well
          Code:
          File.Open("", "d:\\program1", SW_SHOWNORMAL);

          Comment

          • Vaz
            Forum Member
            • Feb 2007
            • 5

            #6
            Thanks guys. I tried fossil's first and it straight away worked.

            Comment

            • Vaz
              Forum Member
              • Feb 2007
              • 5

              #7
              Hi sorry, one last question.

              how do I do it as <the default drive>:\

              Comment

              • TJS
                Indigo Rose Customer
                • Oct 2005
                • 524

                #8
                Depending on what you mean by "default drive" AMS has several Global Variables (or Build-in Variables) that are set dynamically at runtime and might be helpful to you.

                Adapted from the help file:
                Global variables (or "built-in variables") are variables whose values are automatically set when your AutoPlay application starts. They are used to represent common values that might differ between systems. These variables are all global which means you can use them anywhere in your project.

                Tip: The built-in variables are listed along with all of the actions and constants when you press Ctrl+Space in the script editor. Since all of the built-in variables start with an underscore, if you type _ and then press Ctrl+Space, you'll be taken right to the first built-in variable in the list.

                The following global variables are available in AutoPlay Media Studio:

                _DesktopFolder
                The path to the user's Desktop folder. On Windows NT/2000/XP/Vista, this is the path from the per-user profile.

                _DesktopFolderCommon
                The path to the user's Desktop folder. On Windows NT/2000/XP/Vista, this is the path from the All Users profile. On a non-Windows NT system, this will simply be the path to the user's Desktop folder (the same as _DesktopFolder).

                _ProgramFilesFolder
                The user's Program Files folder (typically, this is something like "C:\Program Files").

                _SourceDrive
                The drive that the AutoPlay application was run from (e.g. "C:" or "D:").

                _SourceFolder
                The full path to the folder that the AutoPlay application was run from (e.g. "C:\Downloads" or "D:").

                _SystemFolder
                The path to the user's Windows System folder (e.g. "C:\Windows\System" on non-NT systems, and "C:\Windows\System32" on NT based systems).

                _TempFolder
                The path to the user's Temp folder.

                _WindowsFolder
                The path to the user’s Windows folder (e.g. "C:\Windows").
                Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

                ()))))))))o)))))))==============================================

                Comment

                • Vaz
                  Forum Member
                  • Feb 2007
                  • 5

                  #9
                  Hi,

                  well i've changed the code to:

                  File.Open("_SourceDrive\Winamp", "", SW_SHOWNORMAL);

                  but it doesnt seem to open the folder. (yep, I've added the folders to source directory.

                  Comment

                  • majik92
                    Forum Member
                    • Feb 2007
                    • 11

                    #10
                    Use this:

                    Code:
                    File.Open("_SourceDrive\[COLOR="Red"][B]\[/B][/COLOR]Winamp", "", SW_SHOWNORMAL);

                    Comment

                    • TJS
                      Indigo Rose Customer
                      • Oct 2005
                      • 524

                      #11
                      _SourceDrive is a variable, so it does not need to be contained in the quotes. Try like this:

                      Code:
                      File.Open(_SourceDrive .. "\\Winamp", "", SW_SHOWNORMAL);
                      Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

                      ()))))))))o)))))))==============================================

                      Comment

                      • AudioSam
                        Indigo Rose Customer
                        • Jan 2007
                        • 272

                        #12
                        I think this will work

                        File.Open(_ProgramFilesFolder.."\\Winamp\\Winamp.e xe"); >>>don't know why the .exe is showing with space


                        If its the Winamp player you are wanting to open.
                        Hope this helps,
                        Get the Text App I posted and save this code in F directory
                        so you'll always have the code.
                        AudioSam

                        Comment

                        • AudioSam
                          Indigo Rose Customer
                          • Jan 2007
                          • 272

                          #13
                          Had to add a note

                          File.ExploreFolder("C:\\Program Files\\Winamp", SW_SHOWNORMAL)

                          If its the Winamp folder yau are wanting to open.

                          Comment

                          • ptrut
                            Forum Member
                            • Sep 2009
                            • 1

                            #14
                            Delete folder/s

                            Originally posted by Vaz View Post
                            Hi ianhull,

                            That code bring's up the following dialogue:



                            As apposed to the correct folder open infront of you.
                            I would like to have simaler but to delete chosen folder or folders

                            Thanks

                            Comment

                            Working...
                            X