Yes but I think that's not what I'm looking for. For example (and this is a digression from the subject of this thread, but just an example to show what I mean), how could I arrange for an environment variable to have the value 'work' when I am logged in from work, and 'home' when I am logged in from home ... and for it to have no value at all when I am logged in from a friend's machine which is neither at work nor at home?
The natural way to do this (if it were possible) would be for the plink/putty saved session on my work machine to set the environment variable to 'work', whereas the plink/putty saved session on my home machine sets it to 'home'.
Of course, there are work-arounds. For example, when I log in from home, I could run a script which says 'I am at home'. But (a) I might forget to do that and (b) if this kind of thing can be done automatically by the infrastructure, it is obviously better.
Or, I could use the '-m' parameter in plink/putty to do this. But that would 'use up' this parameter, which could otherwise be put to better use.
I realize this is all rather unimportant compared with everything else which is going on here at the moment, but if anyone would like to take a break from weightier affairs and bend their mind to lightweight puzzles, any suggestions would be welcome.