2 Replies Latest reply on Sep 5, 2010 10:32 PM by Dhruv C

    Get System 32 directory path of a System

    Jayagopal Flex

      Hi,

            I need to get the system directory path ie (the path where system32 folder resides in a system) using flex air.

       

       

      Regards,

      Jayagopal.

        • 1. Re: Get System 32 directory path of a System
          Ansury Level 3

          OS specific, so you may have difficulty with that requirement (not saying it isn't possible).

           

          But in any case, this is a better place to ask:

           

          http://forums.adobe.com/community/air/air_general_discussion

          1 person found this helpful
          • 2. Re: Get System 32 directory path of a System
            Dhruv C

            Hi Jayagopal

             

            Flex not providing any direct access to windows system32 directory as it is OS specific but we can achieve this in our own way

             

            1. You can use the File.desktopDirectory.nativePath to get the path string

            2. You can cut the first three letters those will represent your OS installation drive e.g. x:/, generally its C:/ but not in all case so we do like this.

            3. Now you can append your string to this like driveletter + "WINDOWS/system32"; and can call a method for File to resolve this

            4. File.desktopDirectory.resolvePath(yournewpath)

             

            Below is an example to help and clear you more

             

                        var sFile:File = File.desktopDirectory;
                        var appPath:String = File.desktopDirectory.nativePath;
                        var driveletter:String = appPath.substr(0,3);

                        trace("OS installed Drive: " + driveletter);


                        sFile = sFile.resolvePath(driveletter+"WINDOWS/system32");
                        trace(sFile.nativePath);

             

            This will result you in your system32 path and may help you in your problem.

             

            Thanks

            Dhruv Chauhan