script open a selected file with shared application

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
highend
Posts: 14923
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: script open a selected file with shared application

Post by highend »

Try:

Code: Select all

    if (strpos(<curitem>, ":") != -1) { $item = "\\?\" . <curitem>; }
    else { $item = regexreplace(<curitem>, "^\\\\", "\\?\UNC\"); }
    run """%SystemRoot%\System32\rundll32.exe"" ""%ProgramW6432%\Parallels\Parallels Tools\Plugins\SharedHostApps.dll"",Launch 5919f138425a1941b61b211e81092319 $item";
One of my scripts helped you out? Please donate via Paypal

7iben
Posts: 123
Joined: 04 Apr 2019 18:22

Re: script open a selected file with shared application

Post by 7iben »

Unfortunately not. There seems to be a bug. It only opens the program; the file doesn't open. I've also noticed that it only opens files located directly on the desktop. As soon as they're in a folder, the command stops working:
run """%SystemRoot%\System32\rundll32.exe"" ""%ProgramW6432%\Parallels\Parallels Tools\Plugins\SharedHostApps.dll"", Launch 5919f138425a1941b61b211e81092319 <curitem>";
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

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

Re: script open a selected file with shared application

Post by highend »

It does work for files that don't have space(s) in name or path but not for the ones that have?
One of my scripts helped you out? Please donate via Paypal

7iben
Posts: 123
Joined: 04 Apr 2019 18:22

Re: script open a selected file with shared application

Post by 7iben »

Files containing spaces also open on my desktop.
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

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

Re: script open a selected file with shared application

Post by highend »

Then this is tied to Parallels and how it's working...
One of my scripts helped you out? Please donate via Paypal

7iben
Posts: 123
Joined: 04 Apr 2019 18:22

Re: script open a selected file with shared application

Post by 7iben »

If the folder name on the desktop contains a space, it won't work. If it doesn't, it will work.
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

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

Re: script open a selected file with shared application

Post by highend »

That's exactly the opposite of
Files containing spaces also open on my desktop.
^^
One of my scripts helped you out? Please donate via Paypal

7iben
Posts: 123
Joined: 04 Apr 2019 18:22

Re: script open a selected file with shared application

Post by 7iben »

Sorry, I need to correct myself. I probably pressed the enter key while trying to do this without being in the command line. This caused Xyplorer to start Illustrator as the default application, even though the file contains a space. It's correct as you say. Files and folders with spaces don't work.
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

7iben
Posts: 123
Joined: 04 Apr 2019 18:22

Re: script open a selected file with shared application

Post by 7iben »

Network drives now also work up to the point where a space appears.
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

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

Re: script open a selected file with shared application

Post by highend »

Then fix the quoting of the run call to take that into account...
One of my scripts helped you out? Please donate via Paypal

7iben
Posts: 123
Joined: 04 Apr 2019 18:22

Re: script open a selected file with shared application

Post by 7iben »

Should I adjust something here? I'm not familiar with this:
run """%SystemRoot%\System32\rundll32.exe"" ""%ProgramW6432%\Parallels\Parallels Tools\Plugins\SharedHostApps.dll"", Launch 5919f138425a1941b61b211e81092319 <curitem>";
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

jupe
Posts: 3446
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: script open a selected file with shared application

Post by jupe »

You could try this alternative in x64 too:

Code: Select all

runret("""%SystemRoot%\System32\rundll32.exe"" ""%ProgramW6432%\Parallels\Parallels Tools\Plugins\SharedHostApps.dll"",Launch 5919f138425a1941b61b211e81092319 ""<curitem>""");
else

Code: Select all

run """%SystemRoot%\System32\rundll32.exe"" ""%ProgramW6432%\Parallels\Parallels Tools\Plugins\SharedHostApps.dll"",Launch 5919f138425a1941b61b211e81092319 <curitem_dos>";

7iben
Posts: 123
Joined: 04 Apr 2019 18:22

Re: script open a selected file with shared application

Post by 7iben »

Neither of them work for me on x64. They both work on x32.
Thanks to everyone for the help.
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

Post Reply