How can we hide folder using java language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanchit007
    New Member
    • Feb 2010
    • 8

    How can we hide folder using java language

    Is this the right code to hide a folder using java?

    Code:
    public class kalu
     {
    
        public static void main(String[] args) {
            try
            {            
                Runtime rt = Runtime.getRuntime();
                //put your directory path instead of your_directory_path
                Process proc = rt.exec("attrib -s -h -r j:\sa"); 
                int exitVal = proc.exitValue();
            } catch (Throwable t)
              {
                t.printStackTrace();
              }
    
        }
    }
  • anurag275125
    New Member
    • Aug 2009
    • 79

    #2
    it is giving IllegalThreadSt ateException at line number 10.

    Comment

    • anurag275125
      New Member
      • Aug 2009
      • 79

      #3
      Try this code---

      Code:
      public class hidedir
      {  
      	public static void main(String[] args) throws Exception
      	{
      		String cmd="attrib +h f:\\directory"; Runtime.getRuntime().exec(cmd); 
          
          	   }
      }

      Comment

      • anurag275125
        New Member
        • Aug 2009
        • 79

        #4
        I tested this code on Windows platform and it's working.
        Are you using Linux??

        Comment

        • mazaoa

          #5
          thx it's working for me

          Comment

          • sanchit007
            New Member
            • Feb 2010
            • 8

            #6
            i m also using window xp,7........
            nd using java6 what about u????????

            Comment

            Working...