Winstep

Software Technologies


 Winstep Forums


Print view
Board index : Winstep Forums : General Discussion  [ 7 posts ]
Author Message
 Post subject: Passing two or more files to CMD result in double execution
PostPosted: Sun Aug 09, 2026 11:09 am 
Offline

Joined: Sun Aug 09, 2026 10:51 am
Posts: 4
I'm a new user of the free version of Nexus v26.6.
It works well, looks great, and does almost everything I need it to.

There is one feature I'm missing, though.
When I drag and drop two or more files from Windows 11 File Explorer onto a CMD icon in the Nexus dock, the CMD is executed once for each file.

I cannot find a setting that tells Nexus to pass the files as two or more arguments at once. This is necessary because my CMD needs two or more PDF filenames to merge them into one.

Is there a way for NEXUS to send all the filenames that have been passed to my CMD at once as separate arguments?

You can check it with this small example CMD as new NEXUS dock element:
Code:
@echo off

echo Passed arguments:
echo.

set /a count=1

:loop
if "%~1"=="" goto end

echo Arg%count% = %~1
set /a count+=1
shift
goto loop

:end

PAUSE


Steps:
a) Drag and drop two or more files directly onto the CMD
and
b) Add the CMD to the Nexus dock and drag and drop the same files onto the Nexus icon


Back to top
 Profile  
 
 Post subject: Re: Passing two or more files to CMD result in double execut
PostPosted: Sun Aug 09, 2026 3:09 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 13252
Nexli wrote:
When I drag and drop two or more files from Windows 11 File Explorer onto a CMD icon in the Nexus dock, the CMD is executed once for each file.


Yes, that is the current behavior.

Nexli wrote:
Is there a way for NEXUS to send all the filenames that have been passed to my CMD at once as separate arguments?


Not currently, no.

But you do have a point, if you are dropping several files INTO a single icon then they should ALL be passed as a SINGLE argument (this would be the expected behavior), rather than being passed individually.

Let me see what I can do.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
https://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Passing two or more files to CMD result in double execut
PostPosted: Sun Aug 09, 2026 4:00 pm 
Offline

Joined: Sun Aug 09, 2026 10:51 am
Posts: 4
Winstep wrote:
But you do have a point, if you are dropping several files INTO a single icon then they should ALL be passed as a SINGLE argument (this would be the expected behavior), rather than being passed individually.

Let me see what I can do.

Thanks!

I'm not sure if there are people expecting arguments to be passed individually.
If so, it would be great to have an option - for example in the element's properties - to get the same output as if the files were passed directly to the same CMD.


Back to top
 Profile  
 
 Post subject: Re: Passing two or more files to CMD result in double execut
PostPosted: Sun Aug 09, 2026 5:07 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 13252
Nexli wrote:
I'm not sure if there are people expecting arguments to be passed individually.


I don't think so (or at least I hope not lol), because the normal Explorer behavior is what you originally expected, not what the Winstep application is doing now.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
https://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Passing two or more files to CMD result in double execut
PostPosted: Sun Aug 09, 2026 11:48 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 13252
winstep wrote:
Nexli wrote:
I'm not sure if there are people expecting arguments to be passed individually.


I don't think so (or at least I hope not lol), because the normal Explorer behavior is what you originally expected, not what the Winstep application is doing now.


And I take that back. I implemented the code to pass multiple dropped files in a single launch, and this works fine with your script, for instance.

The problem is that most applications do not seem to accept multiple filenames in a single launch. So, if you want to open multiple text files in Notepad, for instance, by dropping them onto the Notepad shortcut in the dock, the previous method could actually accomplish this by launching multiple instances of Notepad, one for each document.

The new method launches Notepad only once and passes all the filenames as separate command-line arguments, but Notepad completely ignores every filename after the first. Most other applications seem to behave like this too - although your script handles it properly and shows each file as a separate argument.

So, in a way, the old method was actually preferable.

Therefore I think you are right: I should keep the old method as the default and add a new setting to the Item Properties dialog, something like "Launch once for multiple dropped files", which forces the new behavior for that particular item.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
https://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Passing two or more files to CMD result in double execut
PostPosted: Mon Aug 10, 2026 1:35 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 13252
Please download the latest beta from here:

viewtopic.php?p=51217#p51217

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
https://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Passing two or more files to CMD result in double execut
PostPosted: Mon Aug 10, 2026 10:34 am 
Offline

Joined: Sun Aug 09, 2026 10:51 am
Posts: 4
Thank you very much for providing v26.8 (Beta 5) so quickly!

Your new feature works perfectly and meets our expectations exactly!
Image

German translation suggestion for "Launch once for multiple dropped files"
"Nur einmal starten bei mehreren fallen gelassenen Dateien"
or
"Nur einmal starten bei mehreren hineingezogenen Dateien"
or shorter:
Replace "einmal" with "1x"

I don't know how you translate "drop" into German in other parts of your tool.

It might help if you would provide a real example in your Help section, such as
'... to merge two PDF files into one in a CMD batch file...'.


Back to top
 Profile  
 
Post new topic Reply to topic Board index : Winstep Forums : General Discussion  [ 7 posts ]
Display posts from previous:  Sort by  

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot], GPT [Bot] and 146 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: