Execution from command line and cmd-file

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Execution from command line and cmd-file

Post by zakhar »

Hello, XY-Forum!
Why can xyplorer execute a script from a command line command and do not execute the same script from a cmd-file?

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

Re: Execution from command line and cmd-file

Post by jupe »

If you mean in a batch file, I don't have problems running XY commands contained within a batch file, it works just like from the command line for me, what exactly is the problem you are having?

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Execution from command line and cmd-file

Post by zakhar »

jupe wrote:what exactly is the problem you are having?
Hi, jupe!
Something stupid happens.

I have an x.cmd that call xyplorer twice to run two scripts:
C:\...\xyplorer.exe /new /win=min /script="1.xys"
C:\...\xyplorer.exe /new /win=min /script="2.xys"
and it runs normally, xy returns to the x.cmd and x.cmd runs further.
Then the x.cmd contains a next call
C:\...\xyplorer.exe /new /win=min /script="3.xys"
and all ends: xyplorer can't be seen running and x.cmd ends abruptly on the command that calls xyplorer.
This 3.xys is ok itself: xyplorer runs it from "Scripting/Run script".
If I write a simple y.cmd that contains only the call
C:\...\xyplorer.exe /new /win=min /script="3.xys"
so the 3.xys will be completed normally.
It will run too if I start command line window and type the same command
C:\...\xyplorer.exe /new /win=min /script="3.xys"
manually.
I have even tested this situation by emptying the 3.xys by adding /* and */ for the whole content of the 3.xys to be sure that the script is not responsible for failures and nothing changes. :eh:

There is also another problem that I experienced:
7-Zip and rar.exe do not run in that x.cmd, if they are called after these scripts 1.xys and 2.xys .
Rar.exe complains to not have permission to create temporary archives and 7-Zip seems to have same problems.
At the same time being started by the same commands but from an z.cmd containing only the call to xyplorer
these both 7-Zip and rar.exe work good.

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Execution from command line and cmd-file

Post by zakhar »

I have just discovered, that the structure in a.cmd

Code: Select all

if ddd (
command1
command2=C:\ ... \xyplorer.exe /new /win=min /script=a.xys
command3
)
does not work=a.xys will not start and a.cmd ends abruptly - as I see due to the syntax of xyplorer's command, the braces in the a.cmd structure do not work.
If the above code is written as

Code: Select all

if ddd command1
if ddd command2=C:\ ... \xyplorer.exe /new /win=min /script=....xys
if ddd command3
then a.xys will be completed normally and xyplorer then returns to the a.cmd.

Strange behavior. It does not occurs if other dos commands are in such () structures.

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

Re: Execution from command line and cmd-file

Post by highend »

And it works fine within a braces structure here...

Code: Select all

SET "test=True"

If /i "%test%" == "true" (
	"R:\XYplorer_fresh\xyplorer.exe" /new /win=min /script=a.xys
	"R:\XYplorer_fresh\xyplorer.exe" /new /win=min /script=b.xys
	"R:\XYplorer_fresh\xyplorer.exe" /new /win=min /script=c.xys
)
While a.xys contains:

Code: Select all

    new("R:\XYplorer_fresh\a.txt");
b and c the same vice versa, only with their letter for the new file...
One of my scripts helped you out? Please donate via Paypal

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Execution from command line and cmd-file

Post by zakhar »

Thank you, highend.
Something wrong is here in my command line.
I can not find out what it is. And the probability is very high it hangs not on xyplorer.
Therefore I don't think it is appropriate to employ this forum this such problems.
This topic can be deleted, if there is no interest to keep it :|

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

Re: Execution from command line and cmd-file

Post by highend »

Post the REAL content of the .cmd file and the real contents of all involved script files...
One of my scripts helped you out? Please donate via Paypal

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Execution from command line and cmd-file

Post by zakhar »

Dear highend!
As I wrote above I see that the problem is not in xyplorer or in its scripts written by me.
The problem is my cmd-file writing, which I would like to master by myself.
The responsivity of xyplorer's forum is in no way in doubt :)

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

Re: Execution from command line and cmd-file

Post by highend »

The problem is my cmd-file writing
I doubt that, hence my questions...
One of my scripts helped you out? Please donate via Paypal

Post Reply