On 2013-02-14 10:49, John Gray wrote:
> Excellent idea - however OpenFiles doesn't work on 64-bit!
My computer is 64-bit hardware with 64-bit software. I wonder what the
difference is between your computer and my computer that causes
OpenFiles to fail on yours.
Perhaps the difference is not in the computers but in our thoughts on
using OpenFiles. On my system with Administrator privilege I get:
C:\>openfiles
ERROR: Unable to retrieve data.
The system could not find the environment option that was entered.
Files opened remotely via local share points:
---------------------------------------------
INFO: No shared open files found.
And no ERRORLEVEL is set. Perhaps that's what you mean by saying that
it fails. But in a console without Administrator privilege I get:
C:\>openfiles
ERROR: Logged-on user does not have administrative privilege.
And the ERRORLEVEL is set to 1. So it may be true that on a 64-bit
system, OPENFILES is good for nothing except checking administrator
privilege on the local system, and open files on remote 32-bit systems.
If that's true then maybe it will vanish when MS decides that 32-bit
system no longer have a right to live.
> (In your experience, has %windir% ever,ever, had its contents
> changed?)
In my experience, if something CAN be done then someday someone WILL do
it. Things also happen accidentally. I don't know why you asked about
"WINDER" specifically but I seem to recall that things will fail to run
if it isn't set correctly. I think I did that once. The same occurs
with "PATH", but "PATH" has been accidentally deleted on my system
several times.
On my system I do often rely on preexisting environment variables, but I
try to avoid using them when I write scripts for other systems.
Sometimes it can't be avoided, and when that happens it just means the
script is a little less reliable then I wish.
Frank