XYPlorer thinks file is in Program Files x86 but it is not

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
riveter
Posts: 1
Joined: 12 Dec 2024 15:59

XYPlorer thinks file is in Program Files x86 but it is not

Post by riveter »

The vjoy folder is in Program Files. XYPlorer thinks it is in Program Files x86 but there is nothing there.
Is there a fix for this?
xyplorer vjoy location.png
xyplorer vjoy location.png (203.96 KiB) Viewed 779 times

xy123
Posts: 209
Joined: 17 Sep 2017 11:46
Location: Win10 64-bit, @100%

Re: XYPlorer thinks file is in Program Files x86 but it is not

Post by xy123 »

Yes, right click on your shortcut, than Properties, than change Program Files (x86) into %ProgramW6432%

Of course, don't change it if your file/folder is really in Program Files (x86).

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: XYPlorer thinks file is in Program Files x86 but it is not

Post by highend »

Probably a way to fix this is by running a script while the shortcut must be selected...

If the target is in a UAC-protected folder, XY must be running with admin permissions^^

Code: Select all

    // https://www.xyplorer.com/xyfc/viewtopic.php?t=28168
    // C:\Program Files (x86) | C:\Program Files | %ProgramW6432%

    $vbsFile    = "%TEMP%\~xy_replace_shortcut_path.vbs";
    $replace    = '%ProgramW6432%';
    $vbsContent = <<<>>>
Option Explicit

Dim objShell
Dim objLink
Dim strLinkFile
Dim strFindText
Dim strReplaceText
Dim strNewTarget

Set objShell = CreateObject("WScript.Shell")

strLinkFile    = WScript.Arguments(0)
strFindText    = objShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
strReplaceText = "$replace"

Set objLink = objShell.CreateShortcut(strLinkFile)

strNewTarget = Replace(objLink.TargetPath, strFindText, strReplaceText)
objLink.TargetPath = strNewTarget
objLink.Save

Set objLink = Nothing
Set objShell = Nothing
    >>>;

    if (exists($vbsFile) != 1) { $status = writefile($vbsFile, $vbsContent); }
    $result = runret("""cscript.exe"" //Nologo ""$vbsFile"" ""<curitem>""", "%TEMP%", 65001);
    if ($result) { text $result; }
One of my scripts helped you out? Please donate via Paypal

Post Reply