saifullah khan

saifullah khan

  • NA
  • 335
  • 295.2k

can't hide file of through cmd using c#

Nov 10 2012 10:51 AM
hey there.
i am trying to hide two file in my flash drive through cmd command that are being executed in c# windows form here is the code:

 System.Diagnostics.Process process1 = new System.Diagnostics.Process();
            System.Diagnostics.ProcessStartInfo startInfo1 = new System.Diagnostics.ProcessStartInfo();
            startInfo1.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
            startInfo1.FileName = "cmd.exe";
            startInfo1.Arguments = "attrib  +s +h G:\\autorun.inf";
            process1.StartInfo = startInfo1;
            process1.Start();
 
i have also tried this one

 System.Diagnostics.Process.Start("cmd", "attrib  +s +h G:\\autorun.inf");
 
But i does not work.
Please tell me what i need to do to hide the file
Thanks in advance

Answers (1)