2
ghisler(Author)
The meaning of the question is the opposite. As a regular user - in most cases I won't pay attention to the need for quotes at all.
And it is easier and more correct to always determine their necessity by the program itself!
After all, how was that primary command formed, which in fact turned out to be invalid?
let's try to find out... As we know from the help: CM_COPY supports among others these params:
Code: Select all
T="path": Target path, MUST be put in double quotes, and end with a backslash if a directory,
or with a file mask with wildcards to rename files
W="wildcards": Copy only files of this type
And I immediately notice that, unless otherwise stated, the order of the parameters must be literal and equal to that stated in the help!
This I mean that if the parameters can be interchanged, then somewhere it is worth mentioning. I haven't seen this yet.
So the initial cmd line will be:
Code: Select all
CM_COPY /T="path_name"W="file_type"
Now we improve our intermediate variables `path_name` && `file_type`
The path should contain the expected final name of the selected file (the file under the cursor) so it will be "*.bak" - we want only to change the extension and help stated that we must use here double quotes...
But stop! we forgot the full path! So it will be "%P*.bak". Here we will use %P = the source path.
Ok this is done, so let move to another var: `file_type`. By this we mean simply current file, the file under the cursor. So obviously it should be simple %N, and as help DOES NOT stated any special for this `W` param - we leave it as-is. This we only replace our variables with their full values.
And SO, finally our line will look like this:
NB! Please pay attention of initially double double quotes for T param. This is done so exactly because the help section ALREADY contains them (see corresponding quote above)!
So I must change only INTERNAL part of the param's value - and the overall view of it is already predefined by you in this help: T="path" and W="wildcards". Double quotes ALREADY MUST exist here!
And that's how everything is. The average user will actually decide that he has fulfilled all the conditions for the formation of this line.
After all, nothing more important/necessary in the help is not said. EVEN in the form of some kind of cross-reference to another help topic.
As a result, exactly this mentioned above line that will be launched .. And .. and nothing will work as it was required.
And now tell me - with the help of which help/which part/section of it, the user should guess what needs to be done to change the view into this:
Why can't the program itself do this quietly from the user?