fortwunty
Jul 16 2006, 02:08 PM
Okay, I know the registry key per-user is HKCU\Environment\Prompt to set the prompt value, but how would I go about actually setting a per-user prompt? I tried this... at T-12, in one of my .cmd files being called, this launches:
REG ADD "HKCU\Environment" /v "PROMPT" /t REG_EXPAND_SZ /d "$C%USERNAME%$F$S$P$G" /f
For this sort of output:
(username) C:\WINDOWS\system32
Now, when I launch that at the T-12 stage, I don't think %USERNAME% is being evaluated at all, because I get () C:\WINDOWS\system32. The users are created in the .cmd file right before this one.
Would I be better off setting a global prompt? Or should I add something to RunOnceEx to just force this in there?
Sunil
Jul 19 2006, 06:54 PM
I really doubt the install uses an account to do the intial configuration, so it probably would not evaluate the var.
Delprat
Jul 20 2006, 01:15 AM
%username% is evaluated once at the moment you launch the command line (and is not written in the registry).
If you escape the percents (^%username^%), it will write %username% in the registry, but it will not evaluate it before displaying the prompt.
Thus, to get the prompt you expect, you need to set each user's PROMPT var with the real username in. A good way to do that is by running it on the first user logon.
++
T D
Jul 20 2006, 12:44 PM
After setting up users, do it
http://unattended.msfn.org/unattended.xp/view/web/27/If you use net user blahblahblah /add method, in [Guirunonce] of winnt.sif, you can put "%path%\batch.cmd" and of course, in batch.cmd, you have "REG ADD "HKCU\Environment" /v "PROMPT" /t REG_EXPAND_SZ /d "$C%USERNAME%$F$S$P$G" /f"
Then it will onyl apply to user blahblahblah.
Sorry if this doesn't help, I don't fully understand.
fortwunty
Jul 21 2006, 04:40 PM
QUOTE
Sorry if this doesn't help, I don't fully understand.
This was exactly what I needed... and I had tried something almost exactly like this, but forgot something and it went to hell. Thanks for the help. Only problems I'm having trouble with now is the %USERPROFILE% being recognized from a .cmd called from RunOnceEx. Big thanks though.
Innocent Devil
Jul 23 2006, 01:07 AM
do it from T13 to HKCU
after finalizing install windows make that HKCU as HKU\.DEFAULT
oops i sorry
poting without reading it
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.