• SendTo 2 locations

    From Newyana2@3:633/280.2 to All on Sat Apr 6 03:08:39 2024
    I'm wondering if there's any protocol for making a
    shortcut link to 2 places. Not sync or anything like
    that. I want to go right-click -> SendTo -> Backup1
    and have that target lnk file point to, say, D:\Backup
    and G:\Something\orOther. Then thre right-clicked
    file would be copied to both locations.

    I think I can do it by putting VBScripts into the SendTo
    folder, but I was hoping there might be a simple
    approach using lnk files.



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Big Al@3:633/280.2 to All on Sat Apr 6 03:31:39 2024
    On 4/5/24 12:08 PM, Newyana2 wrote:
    I'm wondering if there's any protocol for making a
    shortcut link to 2 places. Not sync or anything like
    that. I want to go right-click -> SendTo -> Backup1
    and have that target lnk file point to, say, D:\Backup
    and G:\Something\orOther. Then thre right-clicked
    file would be copied to both locations.

    I think I can do it by putting VBScripts into the SendTo
    folder, but I was hoping there might be a simple
    approach using lnk files.


    There is a 'send to' folder in you home directory, I'm not sure what can be put there, I have a few
    ..lnk files. I'm sure there is more to it than that, but you could try putting a batch file in
    there that would popup something. From what I see, the file you right click is passed to the .lnk.
    --
    Linux Mint 21.3 Cinnamon 6.0.4 Kernel 6.5.0-26-generic
    Al


    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From R.Wieser@3:633/280.2 to All on Sat Apr 6 03:49:53 2024
    Newyana2,

    but I was hoping there might be a simple
    approach using lnk files.

    Something like "cmd /c start {prog1} & start {prog2}" perhaps ?

    Probably will flash a console window though. :-\

    Regards,
    Rudy Wieser



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From R.Wieser@3:633/280.2 to All on Sat Apr 6 18:27:53 2024
    Newyana2,

    Something like "cmd /c start {prog1} & start {prog2}" perhaps ?

    The above will apply an/the argument (filename) only to the last program.
    :-(

    To apply the argument to both programs a bit of a trick needs to be used :

    cmd /c for %a in ("{prog1}" "{prog2}") do %a

    This starts the second program only after the first one has finished
    (setting the shortcut to run "minimized" will hide the console window).

    To start both at the same time just include 'start "title"' after the "do".

    regards,
    Rudy Wieser



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From MikeS@3:633/280.2 to All on Sat Apr 6 22:22:54 2024
    On 06/04/2024 08:27, R.Wieser wrote:
    Newyana2,

    Something like "cmd /c start {prog1} & start {prog2}" perhaps ?

    The above will apply an/the argument (filename) only to the last program.
    :-(

    To apply the argument to both programs a bit of a trick needs to be used :

    cmd /c for %a in ("{prog1}" "{prog2}") do %a

    This starts the second program only after the first one has finished
    (setting the shortcut to run "minimized" will hide the console window).

    To start both at the same time just include 'start "title"' after the "do".

    regards,
    Rudy Wieser


    As already suggested by Big Al, all that is needed is a batch file in
    the SendTo folder. The filename that is sent to it can be used (as %1)
    as many times as required by commands in the batch file, eg
    Copy %1 D:\Backup
    Copy %1 G:\Something\orOther

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Newyana2@3:633/280.2 to All on Sat Apr 6 22:39:59 2024
    On 4/6/2024 3:27 AM, R.Wieser wrote:

    To apply the argument to both programs a bit of a trick needs to be used :

    cmd /c for %a in ("{prog1}" "{prog2}") do %a

    ˙˙˙ Thanks, but what I was looking for was a way to make
    a lnk file do double duty in copying a file. Maybe that's not
    possible. If not then I'll use VBScripts. I tested a VBS in
    SendTo. WScript.Arguments(0) gets the full path of the
    right-clicked file.

    ˙˙ One pleasant surprise with Win10 is that it's not hard
    to change icons. So I can probably set a folder icon˙ on
    the SendTo menu.

    ˙˙˙ This is because I've set up redundant drives and I often
    save articles by copying webpage text to Notepad and saving
    a simple text file. The target folders are topics like security,
    privacy, ideas, sample code, etc. So if I see an interesting
    article about, say, privacy, I want to right-click that file on
    the Desktop and send it to both privacy folders.

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From R.Wieser@3:633/280.2 to All on Sun Apr 7 00:05:27 2024
    Newyana2,

    cmd /c for %a in ("{prog1}" "{prog2}") do %a

    Thanks, but what I was looking for was a way to make a lnk file do double duty in copying a file.

    Why do you think it doesn't ? Have you already tried ?

    I tested a VBS in SendTo. WScript.Arguments(0) gets the full path of the right-clicked file.

    In the above solution the full path of the file will be appended to that
    line (by the .lnk mechanism).

    If you want to test that you could, in a shortcut, try "cmd /c echo the file is : ".

    hmmm... that might be a problem, as the console window will close
    immediatily after executing the echo. Ah yes, ofcourse: change the "/c" to
    a "/k".

    For bonus select two (or more) files and drag-and-drop them onto the
    shortcut. :-) Also works when you select multiple files and use "SendTo".

    One pleasant surprise with Win10 is that it's not hard
    to change icons. So I can probably set a folder icon on
    the SendTo menu.

    I take it you mean you want to change the icon of what is placed in the
    SendTo folder. For shortcuts changing the icon is easy. In my OS (XP) I cannot do that for a VBScript file or alike. In that case I store such scripts elsewhere, and put a shortcut to them into the SendTo folder.

    This is because I've set up redundant drives and I often
    save articles by copying webpage text to Notepad and saving
    a simple text file. The target folders are topics like security,
    privacy, ideas, sample code, etc. So if I see an interesting
    article about, say, privacy, I want to right-click that file on
    the Desktop and send it to both privacy folders.

    In that case you might also consider a program which will monitor a folder
    for changes, and if so copy the changed file(s) to another one.

    Regards,
    Rudy Wieser



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From R.Wieser@3:633/280.2 to All on Sun Apr 7 00:10:46 2024
    Mike,

    As already suggested by Big Al, all that is needed is a batch file in the SendTo folder.

    The problem with that is that neither Big Al nor you have bothered to
    actually read the first post.

    If you would have you would have noticed that Newyana2 wrote that he already could "do it by putting VBScripts into the SendTo folder".

    IOW, /he already has/ such a solution.

    Regards,
    Rudy Wieser



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From R.Wieser@3:633/280.2 to All on Sun Apr 7 00:55:48 2024
    Newyana2,

    Thanks, but what I was looking for was a way to make a lnk file do double duty in copying a file.

    Ackk... I just realized that a simple copy command will cause a problem :
    the source filename needs to come /before/ the target. And as the source filename is, by the .lnk mechanism, always glued to the end of the string
    ....

    IOW, I think that in your case you can't use my single-line .lnk solution,
    and your vbscript one is the better one.

    Not that that is a bad thing, 'cause batch has a problem with strings - or
    more precise : with "control characters" embedded in them. For funzels just put a "&" in the middle of a filename and try a simple "cmd /c wordpad {thefilename}" with it. Same-ish for "^" and a few others.

    Regards,
    Rudy Wieser




    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From R.Wieser@3:633/280.2 to All on Mon Apr 8 19:32:07 2024
    Newyana2,

    Ackk... I just realized that a simple copy command will cause a problem : the source filename needs to come /before/ the target. And as the source filename is, by the .lnk mechanism, always glued to the end of the string ...

    As far as I can tell the following will work :

    cmd /c for %a ("{path1}" "{path2}") do cd %a ^& copy

    (notice the use of "^&")

    In other words: change to the target folder first, than copy (into that folder) the source file. Should also work when you select multiple files.

    Regards,
    Rudy Wieser



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Philip Herlihy@3:633/280.2 to All on Mon Apr 8 20:44:12 2024
    In article <1e0d2587-f0e8-e80a-de3e-3fc04d0c563c@invalid.nospam>, Newyana2 wrote...

    On 4/6/2024 3:27 AM, R.Wieser wrote:

    To apply the argument to both programs a bit of a trick needs to be used :

    cmd /c for %a in ("{prog1}" "{prog2}") do %a

    ˙˙˙ Thanks, but what I was looking for was a way to make
    a lnk file do double duty in copying a file. Maybe that's not
    possible. If not then I'll use VBScripts. I tested a VBS in
    SendTo. WScript.Arguments(0) gets the full path of the
    right-clicked file.

    ˙˙ One pleasant surprise with Win10 is that it's not hard
    to change icons. So I can probably set a folder icon˙ on
    the SendTo menu.

    ˙˙˙ This is because I've set up redundant drives and I often
    save articles by copying webpage text to Notepad and saving
    a simple text file. The target folders are topics like security,
    privacy, ideas, sample code, etc. So if I see an interesting
    article about, say, privacy, I want to right-click that file on
    the Desktop and send it to both privacy folders.

    Interesting question: the answer to your original question is no. A link (including shortcuts, junction points, etc) will provide a further independent address pointing to a single existing location; whereas ideally you want a single address pointing to two independent locations. No such thing in Windows
    (that I'm aware of!). So some sort of scripting is your only answer, as you've
    already tried. (Note VBScript is being deprecated and will disappear from W11 before that long - think PowerShell perhaps.)

    I see you want more than just backup, in which case I'd have plugged the invaluable File History, which seems to me to get less mention than it deserves
    - I think it's wonderful!

    You're wanting to copy nuggets of information to different folders. But a folder is only really a sort of "index", and that can be achieved without the risks of copying the data. (If you copy an article, and find that there's a mistake in it, you could end up with one version corrected and one uncorrected - it's something to be avoided generally.) So maybe thinking more in terms of maintaining indexes to your records might be appropriate. One way is to store the file in one place and put shortcuts in the other folders to which it might seem relevant. Or go a step further and maintaining your indexes as documents which contain those shortcuts (giving the option of adding comments). If you take that to its logical conclusion you end up where I'm happy to find myself.
    I almost never store "snippets" as files; I put them in my well-structured OneNote hierarchy, where I can use formatting for emphasis, add notes, and cross-link to and from other locations in OneNote. If a file is bulky I'll identify a suitable folder (just one) and then include a link to the folder in all the OneNote pages which need it. With a nice little symbol so I can spot it easily. I think of OneNote as "the index to my life" and couldn't live without it now.

    One little problem I had to solve might be of interest, given that you asked about links. I put just about everything in OneDrive, which syncs beautifully across my various devices, so I can walk away from my PC (after a quick sync check), pick up my laptop in another building, and carry on what I was doing. But MS, in its wisdom, tends to give the same MS account different filesystem addresses for the account in the \Users folder. So the links didn't work. Now, on any new device, if the original folder on my main machine is, say: C:\Users\FOO\OneDrive\Meetings
    .... and the new device has my OneDrive account at: C:\Users\BAR\OneDrive\Meetings
    .... I simply create a hard link C:\Users\FOO pointing to C:\Users\BAR, and hey-
    presto all my links work.

    Not the suggestions you'd have been expecting, I figure!

    --

    Phil, London

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)