![]() |
|
[.NET] How to set folder arrtibute to hidden using vb.net - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] How to set folder arrtibute to hidden using vb.net (/showthread.php?tid=5320804) |
How to set folder arrtibute to hidden using vb.net - -Various - Jun 28, 2016 I'm trying to set fodler arrtibute to hidden using vb.net Code IO.File.SetAttributes("%appdata%", & ("\test")"but its not working.. thanks in advance i'm new to this. * - Neos07 - Jun 28, 2016 Try this: Code IO.File.SetAttributes(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\test", IO.FileAttributes.Hidden)* - He B TeMy - Jun 28, 2016 Post above code will only apply the attribute to the folder, if you want to hide the folder's content (either other folders or files) you'll have to do it for each file/folder. * - -Various - Jun 28, 2016 (Jun 28, 2016 10:40 AM)Neos07 Wrote: Try this:I get this error
* - Odus - Jun 28, 2016 (Jun 28, 2016 10:48 AM)-Various Wrote: I get this error Not his fault you can't even use your clipboard correctly.
* - -Various - Jun 28, 2016 (Jun 28, 2016 11:00 AM)Odus Wrote: Not his fault you can't even use your clipboard correctly.I copy pasted it exactly * - Neos07 - Jun 28, 2016 (Jun 28, 2016 11:08 AM)-Various Wrote: I copy pasted it exactly Please provide a screenshot of that part of code. * - breaker1911 - Jun 28, 2016 you just need to set the right name of the folder like this Code import system.ioyou can use this instead %appdata% Code my.computer.specialdirectory.appdataif i don't wrong, it will work. * - Zettabit - Jun 28, 2016 (Jun 28, 2016 11:08 AM)-Various Wrote: I copy pasted it exactly Just re-write that line, not C+P it and it should work. Visual Studio does stupid shit occasionally, which is probably why it's giving you errors. |