sc RUN refuses 64 bit exe

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

sc RUN refuses 64 bit exe

Post by SkyFrontier »

A simple
run "path to 64.exe";
is producing a "system cannot find the specified file", which proves wrong as "path to 64.exe" on AB finds it normally.
Elevated instance of XY.
Any hints?
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: sc RUN refuses 64 bit exe

Post by admin »

What is the path?

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: sc RUN refuses 64 bit exe

Post by SkyFrontier »

D:\soft\TypingAssistant_USB_7_0\Typing Assistant64.exe
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: sc RUN refuses 64 bit exe

Post by admin »

Show your code...

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: sc RUN refuses 64 bit exe

Post by bdeshi »

Code: Select all

...Typing Assistant64.exe
         ^
there's a space in my boots the path. Enclose in quotes.

Code: Select all

run '"D:\soft\TypingAssistant_USB_7_0\Typing Assistant64.exe"';
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: sc RUN refuses 64 bit exe

Post by admin »

Next version will show an improved error message that will immediately point to such quoting mistakes...

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: sc RUN refuses 64 bit exe

Post by SkyFrontier »

Do I really need to put it under 'single"double"' quotes? Never had this problem, before... (And yes, now I see it's not a x64.exe related problem... And since I never needed to run .exes from paths having spaces, until today, I was unaware of such requirement - thinking double quotes were enough to deal with this)
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: sc RUN refuses 64 bit exe

Post by PeterH »

SkyFrontier wrote:Do I really need to put it under 'single"double"' quotes?
The 1st operand of the run command is "what to run" - this includes the program *and* it's operands. I.e. "D:\soft\TypingAssistant_USB_7_0\Typing Assistant64.exe" /once
In this example you see that program and operand are separated by blank.
In your case the blank wrongly separates a command (up to the blank) from an operand (behind the blank) - which is obviously wrong. So you have to specify the program in double quotes. (This is Windows syntax!)
All this is a string - and to specify a string in XY you have to quote it.

Imagine you would want to start your program with the operand /once! You would specify:
run '"D:\soft\TypingAssistant_USB_7_0\Typing Assistant64.exe" /once';
Here you see that outer (here: single) and inner (here: double) quotes are not on the same level.

As outer quotes you also could use double quotes - but then you'd have to double the inner double quotes - the result is identical:
run """D:\soft\TypingAssistant_USB_7_0\Typing Assistant64.exe"" /once";

Stef123

Re: sc RUN refuses 64 bit exe

Post by Stef123 »

Glad to see I am not the only who trips up on this. :wink:
Important side note that only registered with me after re-reading SC help several times over again: You cannot use single quotes if you pass parameters that need to be resolved, such as

Code: Select all

run """D:\..blahblah\Typing Assistant64.exe"" /once ""<curitem>\""";
openwith ("""path_to_ArchiveHandler"" x -- <items> ""<curpath>""", m) ;
And these are easy (!) examples. When running an app.exe by passing it (and it's parameters) to console.exe things get nested even further. I use many such calls because XY has become my central dashboard and launchpad. And yet I still find it impossible to construct my terms inside SC. Without the color-highlighting of external editors I'd be lost. But that means pasting back and forth between XY and the external editor to step-run and debug.

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: sc RUN refuses 64 bit exe

Post by SkyFrontier »

Hi, Peter. Thanks for the explanation.
What's new to me here is: if I don't have any explicit parameter, I thought the outer single quote wasn't necessary at all. Depending on what Don will do about, I'll have a good bunch of run-related scripts to revise anytime soon. :sigh:
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Stef123

Re: sc RUN refuses 64 bit exe

Post by Stef123 »

SkyFrontier wrote:What's new to me here is: if I don't have any explicit parameter, I thought the outer single quote wasn't necessary at all.
If I am to believe my own notes/ help compilation, the SC engine strips off outer double quotes. So your call would actually pass "Assistant64.exe" as a parameter because it is preceded by a space.

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: sc RUN refuses 64 bit exe

Post by admin »

Sigh. Non-programmers... :roll:

Man, this is all totally normal, simple, and non-confusing. If you find your lines hard to read break them up into variables:

Code: Select all

$app_quoted = quote("D:\soft\TypingAssistant_USB_7_0\Typing Assistant64.exe");
  run "$app_quoted /once";
Etc.

Stef123

Re: sc RUN refuses 64 bit exe

Post by Stef123 »

Sigh. Programmers... :naughty:
Meaning to make things easier by introducing yet another complication - variables. Well, glad I have read far enough in SC help to not get thrown off by it :wink:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: sc RUN refuses 64 bit exe

Post by bdeshi »

Here's another method without using variables:

Code: Select all

  run <<<#CMD
"D:\soft\TypingAssistant_USB_7_0\Typing Assistant64.exe"#CMD ;
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: sc RUN refuses 64 bit exe

Post by PeterH »

Programmers - yes, but...

If you want to specify some "text" to be used in XY, be it for a variable, or for some operand, this is a string.
To define where the string stops and starts you have to surround it by quotes.
Numbers *can* be just seen as numbers and specified unquoted, or can be quoted. The result is the same.

Now compare:

Code: Select all

 $var = 5;     // might also be "5" or '5'
 echo 3 + $var;
 echo "3 + $var";
 echo '3 + $var';
As the results of the lines are different, *you* have to tell XY by use of quotes *what* you want. So (exact) quoting makes sense.
And it can't be helped: you must use the rules of XY to be able to tell it what you want. Else you won't achieve what you want.

Though it's true: it's getting a bit harder if you need quotes *inside* of a string.

Post Reply