Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

How to set folder arrtibute to hidden using vb.net

I'm trying to set fodler arrtibute to hidden using vb.net



Code
IO.File.SetAttributes("%appdata%", & ("\test")"
IO.FileAttributes.Hidden)

but its not working..
thanks in advance i'm new to this.
Try this:
Code
IO.File.SetAttributes(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\test", IO.FileAttributes.Hidden)
And make sure you have the folder "test" in AppData\Roaming.
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.
(Jun 28, 2016 10:40 AM)Neos07 Wrote:  Try this:
Code
IO.File.SetAttributes(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\test", IO.FileAttributes.Hidden)
And make sure you have the folder "test" in AppData\Roaming.
I get this error
[Image: 5251a455bd.png]
(Jun 28, 2016 10:48 AM)-Various Wrote:  I get this error
[Image: 5251a455bd.png]

Not his fault you can't even use your clipboard correctly.

[Image: 3d835fd37e9542e86029ea75f7de2965.png]
(Jun 28, 2016 11:00 AM)Odus Wrote:  Not his fault you can't even use your clipboard correctly.

[Image: 3d835fd37e9542e86029ea75f7de2965.png]
I copy pasted it exactly
(Jun 28, 2016 11:08 AM)-Various Wrote:  I copy pasted it exactly

Please provide a screenshot of that part of code.
you just need to set the right name of the folder
like this
Code
import system.io
try
if file.exists(yourfiles path) then
file.setattributes("Your files path" , Attribute)
else
msgbox("file not found")
end if
catch ex as exception
msgbox(ex.message)
end try
if some exception happen, write it here and i will see if i can help


you can use this instead %appdata%
Code
my.computer.specialdirectory.appdata

if i don't wrong, it will work.
(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.
шкідливе ПО для ентузіастів

Jabber: [email protected]
[email protected]



Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by iRuSTecHAug 27, 2018 05:02 AM 4 577 Aug 27, 2018 05:02 AM
Last Post: InterGalactic
[C#] by Pim FortuynMar 18, 2017 10:49 AM 12 487 Mar 18, 2017 10:49 AM
Last Post: Pim Fortuyn
[C#] by FileBossJan 2, 2016 08:28 AM 2 176 Jan 2, 2016 08:28 AM
Last Post: He B TeMy