How to get the windows program files path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karthickkuchanur
    New Member
    • Dec 2007
    • 156

    #1

    How to get the windows program files path

    Dear all,
    Please tell me how to get the Windows Xp program file path using java
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    #2
    Take a look at the methods under the File class.

    Comment

    • karthickkuchanur
      New Member
      • Dec 2007
      • 156

      #3
      Originally posted by sukatoa
      Take a look at the methods under the File class.
      File Class cant have the option such getting the PAth of windows directory like
      C:/programfiles

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Read the API specs for the System.getPrope rties method to find out what's available.

        Comment

        • karthickkuchanur
          New Member
          • Dec 2007
          • 156

          #5
          Originally posted by r035198x
          Read the API specs for the System.getPrope rties method to find out what's available.
          No such method
          Iam getting all the details like
          os name
          java path using System etc
          but i cant find the windows OS installation path

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Have a look at one of the System.getEnv() methods.

            kind regards,

            Jos

            Comment

            • karthickkuchanur
              New Member
              • Dec 2007
              • 156

              #7
              Originally posted by JosAH
              Have a look at one of the System.getEnv() methods.

              kind regards,

              Jos
              System.getenv() ;
              its a depricated method

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by karthickkuchanu r
                System.getenv() ;
                its a depricated method
                Since when? Which specs are you looking at?

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Originally posted by karthickkuchanu r
                  System.getenv() ;
                  its a depricated method
                  They only brought it in after great demand in version 1.5. You need other glasses.

                  Jos

                  Comment

                  • karthickkuchanur
                    New Member
                    • Dec 2007
                    • 156

                    #10
                    Originally posted by JosAH
                    They only brought it in after great demand in version 1.5. You need other glasses.

                    Jos

                    Iam using version 1.5

                    Comment

                    • JosAH
                      Recognized Expert MVP
                      • Mar 2007
                      • 11453

                      #11
                      Originally posted by karthickkuchanu r
                      Iam using version 1.5
                      Hurray, so there's your solution.

                      Jos

                      Comment

                      • karthickkuchanur
                        New Member
                        • Dec 2007
                        • 156

                        #12
                        Originally posted by JosAH
                        Hurray, so there's your solution.

                        Jos
                        We find the solution for that !thanks a lot keep in touch to give the solution for my queries

                        Comment

                        • itsraghz
                          New Member
                          • Mar 2007
                          • 124

                          #13
                          How about having a look at "getAbsolutePat h()" and "getCanonicalPa th()" methods of File class?

                          The Java Doc of the methods are below.

                          http://java.sun.com/j2se/1.5.0/docs/...AbsolutePath()
                          http://java.sun.com/j2se/1.5.0/docs/...anonicalPath()

                          Comment

                          • karthickkuchanur
                            New Member
                            • Dec 2007
                            • 156

                            #14
                            Originally posted by itsraghz
                            How about having a look at "getAbsolutePat h()" and "getCanonicalPa th()" methods of File class?

                            The Java Doc of the methods are below.

                            http://java.sun.com/j2se/1.5.0/docs/...AbsolutePath()
                            http://java.sun.com/j2se/1.5.0/docs/...anonicalPath()
                            iam talking about the where windows OS is installes
                            like c:/programFiles/Windows

                            Comment

                            Working...