문제

How can I open Windows Disk Defragmenter using vb.net?

I have tried all the "Google" solutions but none seem to work.

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        Process.Start("dfrgui.exe")

    End Sub

and...

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        Dim sysFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.System)
        Process.Start(sysFolderPath + "\dfrgui.exe")

    End Sub

and...

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        Shell("dfrgui.exe")

    End Sub
도움이 되었습니까?

해결책

I guess you compile your code for x86 target systems. Try x64 as target.

다른 팁

System.Diagnostics.Process.Start("C:\pathhere")

Try this:

Dim Pwd As Security.SecureString

Pwd = New System.Net.NetworkCredential("", "Your Passwork").SecurePassword

Process.Start("dfrgui.exe", userName:="Your UserName", password:=Pwd, domain:="Your Computer Domain or Workgroup")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top