Hello people, it's been a while...
I'm trying to rename a folder located inside the %appdata% folder. I can do it in Windows Explorer no problem, but I can't do it in a batch file, nor can I do it in vb.net. Here's what I have for code:
The source folder does exist, and the destination does not.
When running the code, it gets to the renamedirectory line, and jumps to the catch. Exception error is:
"Access to the path 'C:\Users\Real\AppData\Roaming\.minecraft.1.4' is denied."
I'm going to guess that it's because AppData is a protected folder? Anyway to get around that?
thanks!
Cheers,
Realm174
I'm trying to rename a folder located inside the %appdata% folder. I can do it in Windows Explorer no problem, but I can't do it in a batch file, nor can I do it in vb.net. Here's what I have for code:
Code:
Public Class Form1
Public RootFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Private Sub btnPlay14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay14.Click
'Rename the folders
Try
My.Computer.FileSystem.RenameDirectory(RootFolder & "\.minecraft.1.4", ".minecraft")
'do other stuff...
Catch ex As Exception
End Try
End Sub
End Class
The source folder does exist, and the destination does not.
When running the code, it gets to the renamedirectory line, and jumps to the catch. Exception error is:
"Access to the path 'C:\Users\Real\AppData\Roaming\.minecraft.1.4' is denied."
I'm going to guess that it's because AppData is a protected folder? Anyway to get around that?
thanks!
Cheers,
Realm174