none
How to run apps from System32 Windows 10 RRS feed

  • Question

  • So I can now run the MRT from the system directory but if I use the same procedure to try and run gpedit.msc or Firewall.cpl or any other cpl I can't seem to load it.

     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Process.Start("C:\Windows\Sysnative\MRT.exe")
        End Sub

    The above worked for me for the MRT without an issue. So thank you to those whom helped.

    How do I run using Firewall.cpl or gpedit.msc?


    • Edited by GeGeek Monday, February 26, 2018 3:13 AM
    Sunday, February 25, 2018 1:57 AM

All replies

  • Hi

    Why on earth do you want to try and run the Microsoft Removal Tool? It is associated with virus removal, and is not a stand alone application.


    Regards Les, Livingston, Scotland

    Sunday, February 25, 2018 2:04 AM
  • Because the Malware App is an added feature for my toolkit.
    Sunday, February 25, 2018 2:11 AM
  • Hi

    What do you expect if you were able to run that?

    Suppose you had malicious intentions, then being able to muck around with system files would be very attractive to you - now, if you do not have malicious intent, would you not be happy that such files are not so easy to muck around with?


    Regards Les, Livingston, Scotland

    Sunday, February 25, 2018 2:24 AM
  • You should use this pattern

    Imports System.IO
    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) _
            Handles Button1.Click
    
            Dim path As String = Environment.GetFolderPath(
                If(Environment.Is64BitOperatingSystem,
                   Environment.SpecialFolder.SystemX86,
                   Environment.SpecialFolder.System))
    
            Dim fileName As String = IO.Path.Combine(path, "MRT.exe")
            If File.Exists(fileName) Then
                Process.Start(fileName)
            Else
                MessageBox.Show($"{fileName}{Environment.NewLine}Not Found")
            End If
        End Sub
    End Class
    


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, February 25, 2018 2:53 AM
    Moderator
  • Google GeGeek please, then youll know my intentions are not malicious.
    Sunday, February 25, 2018 2:53 AM
  • Works fine here without the path, since "%WINDIR/System32" is in the %PATH% environment variable

        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            Process.Start("MRT.exe")
        End Sub

    I get the UAC Prompt and then (If I agree)

    Windows 10 x86 build 1703.

    Sunday, February 25, 2018 5:18 AM
  • I don't know how anyone could use MRT for nefarious purposes, it's only capability is to remove Malicious Software.

    Sunday, February 25, 2018 5:23 AM
  • See Mt.exe. That says that a file must exist in the same directory. Perhaps you are executing it in a manner that does not allow the file to be found. Or perhaps not. See MRT not working. That is essentially the problem and the final post there says it is a permission problem.


    Sam Hobbs
    SimpleSamples.Info

    Sunday, February 25, 2018 5:57 AM
  • Works fine here without the path, since "%WINDIR/System32" is in the %PATH% environment variable

        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            Process.Start("MRT.exe")
        End Sub

    I get the UAC Prompt and then (If I agree)

    Windows 10 x86 build 1703.

    Says cant find file looking in the wow64 folder.
    Sunday, February 25, 2018 6:33 AM

  • Keeps saying file now found looking in the syswow64.
    Sunday, February 25, 2018 6:36 AM
  • If the file requires admin rights, how can I run that file.

    Your program needs admin rights.


    Sam Hobbs
    SimpleSamples.Info

    Sunday, February 25, 2018 7:03 AM
  • You must use Wow64DisableWow64FsRedirection

    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
    
    System.Diagnostics.Process.Start("MRT.exe")

    with :

    <DllImport("Kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>
    Private Shared Function IsWow64Process(ByVal hProcess As IntPtr, <Out> ByRef Wow64Process As Boolean) As Boolean
    End Function
    
    <DllImport("Kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>
    Private Shared Function Wow64DisableWow64FsRedirection(<Out> ByRef OldValue As IntPtr) As Boolean
    End Function



    • Edited by Castorix31 Sunday, February 25, 2018 9:12 AM
    Sunday, February 25, 2018 9:11 AM
  • Can I use the same terminology for running the other 2 apps as well and how? Thanks
    Monday, February 26, 2018 4:27 AM