In said:
Well, I'm the administrator here, so that's not an issue.
Evidently HOMEPATH is one of those variables that the system will
define unless there's a system or user variable by the same name.
I haven't found where the default comes from, but I know that one
of the service packs or patches changes that default. If you have
shortcuts defined to open in %HOMEDRIVE%%HOMEPATH%, such a change
can be quite disruptive when the program involved is not cmd.exe.
See advanced user accounts settings for Profile. For a local account
this defaults to "local path" (not specified) and then the HOMEDRIVE,
HOMEPATH are derived from the User's Profile location. In a domain
the account may use Roaming Profiles or the admin (you can do this
with local accounts too) may have set a "Home Folder" mapping and if
so then HOMEDRIVE, HOMEPATH and HOMESHARE are based on that. So this
is an environment variable but not a conventionally set one and not
normally stored as with PATH for example. It is account-specific but
"dynamically" (for want of a better word) created from account
profile information. Hope that's interesting. You may not find
mapping a "Home Folder" to be much to your liking though. <G>
You will find that setting a User environment variable will replace
the value dynamically set by the system from the account information,
as it is applied later in the logon process.
I sure agree about HOMEDRIVE\HOMEPATH in shortcuts though! If you
have a lot of those you might replace the strings in batch using a
shortcut command-line utility perhaps. Or just set those User vars
as you like although I cannot guaranty that that will not possibly
cause a problem in something sometime... YMMV
So, "Autorun" for cmd.exe does what the OP needed and recommend that
method for that purpose.