1
Answer

can't hide file of through cmd using c#

saifullah khan

saifullah khan

11y
1.3k
1
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)