Can't launch "dfrgui.exe" for some reason

Windows specific forum
BarryG
Addict
Addict
Posts: 3318
Joined: Thu Apr 18, 2019 8:17 am

Can't launch "dfrgui.exe" for some reason

Post by BarryG »

Anyone know why both of these fail to launch the drive optimizer of Windows? Its window doesn't open and it's not in the Task Manager. It's not a UAC issue, because I can enter the command into the Windows "Run" box it launches, and I can put "C:\Windows\System32\dfrgui.exe" (without quotes) into a batch file and it launches. This has me stumped! And before anyone asks, substituting app$ with "C:\Windows\SysWOW64\dfrgui.exe" also fails to launch it.

Code: Select all

app$="C:\Windows\System32\dfrgui.exe"
Debug ShellExecute_(0,"open",app$,"",GetPathPart(app$),#SW_SHOW) ; 42
Debug RunProgram(app$) ; 1
breeze4me
Enthusiast
Enthusiast
Posts: 523
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: Can't launch "dfrgui.exe" for some reason

Post by breeze4me »

This is due to redirection in the x86 compiler.

Code: Select all

CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
  app$ = "C:\Windows\Sysnative\dfrgui.exe"  ;Vista+
CompilerElse
  app$ = "C:\Windows\System32\dfrgui.exe"
CompilerEndIf

Debug ShellExecute_(0,"open",app$,"",GetPathPart(app$),#SW_SHOW)
Debug RunProgram(app$)
or use Wow64DisableWow64FsRedirection and Wow64RevertWow64FsRedirection APIs.

BTW, the "\SysWOW64\dfrgui.exe" file seems to be a dummy file.


https://docs.microsoft.com/en-us/window ... redirector
BarryG
Addict
Addict
Posts: 3318
Joined: Thu Apr 18, 2019 8:17 am

Re: Can't launch "dfrgui.exe" for some reason

Post by BarryG »

Okay, thanks for explaining. Shame that I get "success" return numbers (42 and 1) despite NOT launching. Makes me wonder what other apps I am NOT actually launching (especially with #PB_Program_Hide) but naively think I am.
fryquez
Enthusiast
Enthusiast
Posts: 367
Joined: Mon Dec 21, 2015 8:12 pm

Re: Can't launch "dfrgui.exe" for some reason

Post by fryquez »

BarryG wrote:Shame that I get "success" return numbers (42 and 1) despite NOT launching.
Nope, you get success because you successfully launch the program.
But, it's a shame that Microsoft puts a dummy program in SysWOW64 folder instead of a launcher for the native program.
Post Reply