Typing ! or !! in the Address Bar, I want to pull in the highlighted file name or names. I suggest %$, to be consistant with command-line syntax, and you already support % for environment variables.
E.g. !!regsvr32 %$
Writing this, it occurs to me that there must be a way to refer to current items and such in the scripting and custom command area, which I've not read up on, so maybe I missed something. But nothing of the sort is documented under "Address Bar".
Feature for "Executing DOS commands"
-
JDługosz
- Posts: 121
- Joined: 17 Dec 2007 23:22
- Contact:
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Feature for "Executing DOS commands"
The current item would be <curitem>, but this variable is currently not resolved in the context of a DOS command. I'm not sure whether it's a good idea to support such variables in this context, and have no time to think very hard about it. But I will listen to suggestions...
FAQ | XY News RSS | XY X
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Feature for "Executing DOS commands"
Sounds cool.JDługosz wrote:Typing ! or !! in the Address Bar, I want to pull in the highlighted file name or names.
I suggest %$, to be consistant with command-line syntax, and you already support % for environment variables.
E.g. !!regsvr32 %$
Right now i would use:
::run "cmd /k command";
::run "cmd /k echo Hello";
::run "cmd /k echo <curitem>";
::run "cmd /k regsvr32 <curitem>";
(don't know if the quoting is enough here)
- - -
And, BTW, it would be nice if the var <curitemS> would be available here too, to get:
"x:\path\to\name.ext" "x:\path\to\name.ext" "x:\path\to\name.ext"
Worth to open an extra wishes thread for that?
.
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Feature for "Executing DOS commands"
Can anybody enlighten me about %$ ? What's the exact meaning of this and in which contexts is it used?
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Feature for "Executing DOS commands"
Good idea!Stefan wrote:And, BTW, it would be nice if the var <curitemS> would be available here too, to get:
"x:\path\to\name.ext" "x:\path\to\name.ext" "x:\path\to\name.ext"
Worth to open an extra wishes thread for that?
FAQ | XY News RSS | XY X
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Feature for "Executing DOS commands"
%$ is meant as an variable parameter, here for the regsvr32 command.admin wrote:Can anybody enlighten me about %$ ? What's the exact meaning of this and in which contexts is it used?
Analog to an CMD batch
@ECHO OFF
regsvr32 %1
or with XYplorer
run cmd /c regsvr32 "<curitem>";
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Feature for "Executing DOS commands"
Ok, but I think this will be fine as well:Stefan wrote:%$ is meant as an variable parameter, here for the regsvr32 command.admin wrote:Can anybody enlighten me about %$ ? What's the exact meaning of this and in which contexts is it used?
Analog to an CMD batch
@ECHO OFF
regsvr32 %1
or with XYplorer
run cmd /c regsvr32 "<curitem>";
Code: Select all
!!regsvr32 "<curitem>"
!!regsvr32 <selitems>*FAQ | XY News RSS | XY X
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Feature for "Executing DOS commands"
admin> "this will be fine"admin wrote:Ok, but I think this will be fine as well:Code: Select all
!!regsvr32 "<curitem>" !!regsvr32 <selitems>*
So it's not implemented yet? Good!
Otherwise It seams i have problems with the syntax
I don't enjoy to register an dll right now, so
My <curitem> is this batch:
@ECHO OFF
ECHO %1
PAUSE
This works:
::run "<curitem> Hello";
This not:
! "<curitem> Hello";
<selitems> sounds fine.admin wrote: * I prefer <selitems> to <curitems> as var name for your proposal.
<curitemS> was only suggested because i thought there is already <curitemS>, but this is <item> and <items> what i had in mind.
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Feature for "Executing DOS commands"
Actually I just changed it to simply <items> because it is used as such already in UDC OpenWith.
FAQ | XY News RSS | XY X
-
JDługosz
- Posts: 121
- Joined: 17 Dec 2007 23:22
- Contact:
Re: Feature for "Executing DOS commands"
"<curitem>" is a bit much to type, compared to %1 or %$. A command involving "this thing" is the most common reason for using the bar for the purpose, I would think.
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Feature for "Executing DOS commands"
And thus broke the previously expected (and documented) behavior of OpenWith... as now XY's scripting engine will parse the Application argument and resolve "<items>" and then the OpenWith command will parse the arguments and not finding '<items>' append them to the end of the command.admin wrote:Actually I just changed it to simply <items> because it is used as such already in UDC OpenWith.
Therefore, making it a real pain in the butt to position '<items>' among other arguments that are being passed to the application, and of course breaking existing scripts that relied on this behavior.
EDIT: Further experimentation shows that just OpenWith (even as a UDC) is broken as it has forgotten all about '<items>' and will happily expand '<items>' and then append the items again.
EDIT 2: The Return of Edit:
An example:
Using
Code: Select all
"D:\Downloads\Apps\AutoHotkey\My Scripts\Samples\ARGS.exe" -- <items> -STOPv9.40.0104 wrote:1=--
2=D:\Downloads\Apps\Installers\X\XYplorer\9.40.0104.zip
3=D:\Downloads\Apps\Installers\X\XYplorer\9.40.0107.zip
4=D:\Downloads\Apps\Installers\X\XYplorer\9.50.0000.zip
5=-STOP
v9.50 wrote:1=--
2=D:\Downloads\Apps\Installers\X\Xyplorer\9.40.0104.zip
3=D:\Downloads\Apps\Installers\X\Xyplorer\9.40.0107.zip
4=D:\Downloads\Apps\Installers\X\Xyplorer\9.50.0000.zip
5=-STOP
6=D:\Downloads\Apps\Installers\X\Xyplorer\9.40.0104.zip
7=D:\Downloads\Apps\Installers\X\Xyplorer\9.40.0107.zip
8=D:\Downloads\Apps\Installers\X\Xyplorer\9.50.0000.zip
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
XYplorer Beta Club