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?
Execution from command line and cmd-file
-
jupe
- Posts: 3478
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
Re: Execution from command line and cmd-file
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
Hi, jupe!jupe wrote:what exactly is the problem you are having?
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.
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
I have just discovered, that the structure in a.cmd
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
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.
Code: Select all
if ddd (
command1
command2=C:\ ... \xyplorer.exe /new /win=min /script=a.xys
command3
)
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 command3Strange 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
And it works fine within a braces structure here...
While a.xys contains:
b and c the same vice versa, only with their letter for the new file...
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
)
Code: Select all
new("R:\XYplorer_fresh\a.txt");
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
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
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 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
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
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
I doubt that, hence my questions...The problem is my cmd-file writing
One of my scripts helped you out? Please donate via Paypal
XYplorer Beta Club