Page 1 of 1
Can't launch "dfrgui.exe" for some reason
Posted: Sat Jan 02, 2021 11:08 am
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
Re: Can't launch "dfrgui.exe" for some reason
Posted: Sat Jan 02, 2021 3:10 pm
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
Re: Can't launch "dfrgui.exe" for some reason
Posted: Wed Jan 06, 2021 3:34 am
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.
Re: Can't launch "dfrgui.exe" for some reason
Posted: Wed Jan 06, 2021 4:33 pm
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.