Take Ownership of a file/folder
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts
Page 1 of 1
I want to take ownership of Context.exe but it don't let me anyway of takeing ownership of a file in vb that easy?
Code: Select all
it give me and Access is denied errorDim fileName As String = ("C:\Users\Devin\Desktop\Context.exe")
Dim arguments As String = ("takeown /f C:\Users\Devin\Desktop\Context.exe")
System.Diagnostics.Process.Start(fileName, arguments)
You would probably have to run the program as administrator
Hey Harlem9191 i had to use this code
Code: Select all
Dim fileName As String = ("C:\Users\Devin\Desktop\Context.exe")
Interaction.Shell(String.Concat(New String() {"cmd.exe /c takeown /f ", fileName, " && icacls ", fileName, " /grant administrators:F"}), AppWinStyle.Hide, False, -1)
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023