I need to delete a folder

Asked

Viewed 43 times

-3

Hello, using visual studio, I would like to pay the following folder : C: Users leoxs Appdata Local Fivem Fivem.app cache browser

Only this program will be used by other people, and they also need to delete this same folder, only that the "start" (C: Users leoxs) will be different, (Appdata Local Fivem Fivem.app cache browser) this destination is always fixed

How do I delete this folder?

What I tried and didn’t work out: Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click File.Delete("C:\Users\leoxs\AppData\Local\FiveM\FiveM.app\cache\browser") End Sub

1 answer

0

Leonardo, Windows uses environment variables which point to several directories within the system.

In your case, you can use this path:

File.Delete("%USERPROFILE%\AppData\Local\FiveM\FiveM.app\cache\browser")

You didn’t give more details, so I don’t know if this will solve it. But the path you seek is this same %USERPROFILE%\AppData\Local. You can test by copying and pasting the previous string in Windows Explorer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.