This test with PowerShell by adapting your code works for me (Windows 10) as Admin (Manifest with level="requireAdministrator")
Dim bWow64 As Boolean = False
IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, bWow64)
If (bWow64) Then
Dim OldValue As IntPtr = IntPtr.Zero
Dim bReturn As Boolean = Wow64DisableWow64FsRedirection(OldValue)
End If
Dim p As Process = New Process()
p.StartInfo.FileName = "PowerShell.exe"
p.StartInfo.Arguments = "Rename-LocalUser -Name LocalAdmin -NewName LAdmin"
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
p.StartInfo.UseShellExecute = False
p.StartInfo.CreateNoWindow = True
p.StartInfo.RedirectStandardError = True
p.Start()
p.WaitForExit()
Dim sStdErr_psRename As String = p.StandardError.ReadToEnd()
Console.WriteLine("Exit code : {0}", p.ExitCode)
Console.WriteLine("StdErr : {0}", sStdErr_psRename)
Declarations :
<DllImport("Kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>
Public Shared Function IsWow64Process(ByVal hProcess As IntPtr, <Out> ByRef Wow64Process As Boolean) As Boolean
End Function
<DllImport("Kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>
Public Shared Function Wow64DisableWow64FsRedirection(<Out> ByRef OldValue As IntPtr) As Boolean
End Function