how to make different user settings?

D

Defcon31

hello,

i have an administrator account and two user accounts.

1)how can i set a different wallpaper for each of them?

2)how can i create different desktop shortcuts for them?

anyone has experience with this so that everything is being fixed during
FBA.

thanks in advance
 
K

KM

Defcon31,

I had a similar problem and I fixed that by using Autologon feature and a
set of batch files that set up necessary registry, desktop shortcuts and
etc. on first account logons. The implementation required a few
logoff/logons after FBA was finished. The final batch file was cleaning up
all temporary files/settings from device and leaving necesary logon
settings.

KM,
Bsquare Corp.
 
D

Defcon31

i had the same solution in my mind

but do you how do you let that bat-file be executed?
- do you let execute the right bat files yourself ?
- or by setting it in a RunOnceEx key?
and in the second case, in which registry key do you set the
right RunOnces for different users?

thanks in advance !!!!
 
S

Slobodan Brcin

Thanks god that I have only system account.

But my vision of this problem, so you don't need to log manually.

You can make program that will impersonate every user and do required
registry modifications for each of them.
This is rough estimate what could be done.


Second approach would be to save configured user account folder and create
app (xcopy) to restore it during the FBA.
You will need to create new security attributes if you are using NTFS
(cacls). and this should probably work.
This is probably how User Profiles Copy To option that admins use to copy
one configured account to new accounts so users can have preconfigured
settings works.

Regards,
Slobodan
 
K

KM

Defcon31,

I am wondering why you can't use FBA reseal mode? If you set fbareaseal to
launch manually, you can prepeare your runtime image - create and set up
your user accounts as necessary, then manually reseal it and use the image
as your golden image to be copied on to all devices. If you need unique
device names, SIDs and etc., you will have to include System Cloning Tool
component (check XPe docs).

My problem was that I had to automate the setup anyway. So, I ended up
creating a set of batch and .reg files that were self-managed to run under a
few user accounts. After FBA I was using Autologon to log in to particular
user and run a batch file as a All Users/Startup item. Then the batch file
was switching Autologon registry settings to another user, cleaning up
itself and making another batch file as a All User/Startup item. This
scenerio was continueing until all the users were setup. This is a painful
process when you do that first time but when the logic is set up and
understood, it is becoming eaiser to add new things (new files, new
accounts, new settings). Also, I did not have to manually setup the image
each time I changed TD configuration (added/removed/modified components).
Automating post-FBA phase was laso very helpful for image testing and
reproducing purposes (no human errors).

So, answering your questions - I was using All Users (Default User)/Startup
items to launch batch files and import .reg files. I used
RunOnceEx/RunOnce/Run only to register (launch) all user specifics.

You may also use many useful utilities from XP (Win2000) Resource Kit
including cals, cusermgr, ntrights, etc to help yourself to automate the
procedure.

KM,
BSquare Corp.
 
D

Defcon31

hello KM,

today was my lucky day. thanks to you, after many days of trying to
accomplish this, it finaly seems it's going the right way..

i made a batch file and set it in the HKLM....\RunOnceEx registry...
now it sets everything for ONE user.

but how do I have to automate it in the batch file so that
he does it for the other users?
it's not so clear how you do it with that "autologon" always like you
described...
(do you let the batch file logoff and logon maybe?)
(or when the autologon-key changes, does the system saves the HKCU settings
automatically?)
seems all very complicated

is it maybe possible to post your code of your bat files?
it would be a great help for me to accomplish my final school project,

anyway,
thanks in advance!
 
K

KM

Defcon31,

I did not use RunOnceEx for the purpose of setting up user accounts. Using
StartUp batch files appeared to be more clear to accomplish that. However,
all the ugly logic you will see below may be implemented through the
RunOnce[Ex] key.
My batch files are full of info you don't need for your project, they have
got my project's specifics so they won't do much for you.
However, there is nothing smart in the batch files and it is easy to repro
the basic logic here. I'll discribe the scenario:

Assumptions:
Regedit.exe in your image (or reg.exe) ("Registry Editor" component);
XP shutdown.exe in your image (Software : System : System Services :
Base : "Misc. Command Line Tools" component);
"Automatic Logon" component in your image (or you change Autologin
registry values directly);
"Administrator account" and a couple of "User Account" (User 1, User2)
components are in your image. The account properties are set accordingly to
your needs (user groups, password, etc.);
User account group rights enough to modify [HKLM\..\Winlogon] registry
key.

Create a component with a set of batch and .reg files:
Start.bat file under \Documents and Settings\All Users\Start
Menu\Programs\Startup directory.
Place the following files anywhere on target (e.g. under root):
User1.bat, User1.reg - user1 specifics (files, registry settings,
etc.);
AutologinUser1.reg - a reg. file to set User1 autologin;
User2.bat, User2.reg - user2 specifics (files, registry settings,
etc.);
AutologinUser2.reg - a reg. file to set User1 autologin;
Administrator.bat, Administrator.reg - - user2 specifics (files,
registry settings, etc.);
AutologinAdministrator.reg - a reg. file to set Administrator
autologin;
ClearAutologin.reg - a reg. file to clear autologin registry
settings;
(You may add the files to your image with TD Extra Files feature but making
your own component would separate your user account setup logic).

Autologin<User>.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"="<User>"
"DefaultPassword"="<User Password>"
"ForceAutoLogon"="1"
"AutoAdminLogon"="1"
"AutoLogonUser"="<User>"

ClearAutologin.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"=""
"DefaultPassword"=""
"ForceAutoLogon"="0"
"AutoAdminLogon"="0"
"AutoLogonUser"=""

<User>.reg may include any user account specific registry setting depending
on your needs.
<User>.bat files should include:
regedit.exe /s \<User>.reg
del /Q \<User>.reg
+ any user specific logic.

In TD you set "Automatic Logon" settings to log in to any of the user
accounts (e.g. User1). If you set it to User1, you won't need
AutologinUser1.reg.

The Start.bat file should be very simple and make calls to user batch files.
Start.bat:
IF EXIST \User1.bat (
call User1.bat
del /Q User1.bat
regedit.exe /s \AutologinUser2.reg
del /Q \AutologinUser2.reg
goto RESTART
)
IF EXIST \User2.bat (
call User2.bat
del /Q User2.bat
regedit.exe /s \AutologinAdministrator.reg
del /Q \AutologinAdministrator.reg
goto RESTART
)
IF EXIST \Administrator.bat (
call Administrator.bat
del /Q Administrator.bat
regedit.exe /s \ClearAutologin.reg
)
shutdown.exe /f /r /t 03
del /Q "\Documents and Settings\All Users\Start
Menu\Programs\Startup\Start.bat"
goto NOTHING
:RESTART
REM restart...
shutdown.exe /f /r /t 03
:NOTHING

Change Start.bat file to add/remove/modify anything that may be necessary to
meet your project requirements.
You don't necessary need to reboot your device each time you switch the user
but rather to log off (there might be sometimes a need to reboot the device
depending on the user settings you are trying to preset). To log off, change
shutdown call to "shutdown.exe /f /l /t 03".
Also, at the end of the Start.bat file (just before cleaning up itself) you
may change user account rights settings using an appropriate command line
tool from NT/2K/XP Resource Kits (e.g. cusrmgr.exe, ntrights, etc.).
And last hint - you may use reg.exe instead of set of the .reg files.

After the last reboot (log off) device is setup and ready.

Hope this helps,
KM,
BSquare Corp.
 
D

Davide Masino

Hi all,
Please excuse my remark, but why reboot (or log off) the machine for
each user?
I think that doing a 'reg /LOAD' for each ntuser.dat user specific file
could be less 'time consuming' and do the trick anyway.

Defcon31,

I did not use RunOnceEx for the purpose of setting up user accounts. Using
StartUp batch files appeared to be more clear to accomplish that. However,
all the ugly logic you will see below may be implemented through the
RunOnce[Ex] key.
My batch files are full of info you don't need for your project, they have
got my project's specifics so they won't do much for you.
However, there is nothing smart in the batch files and it is easy to repro
the basic logic here. I'll discribe the scenario:

Assumptions:
Regedit.exe in your image (or reg.exe) ("Registry Editor" component);
XP shutdown.exe in your image (Software : System : System Services :
Base : "Misc. Command Line Tools" component);
"Automatic Logon" component in your image (or you change Autologin
registry values directly);
"Administrator account" and a couple of "User Account" (User 1, User2)
components are in your image. The account properties are set accordingly to
your needs (user groups, password, etc.);
User account group rights enough to modify [HKLM\..\Winlogon] registry
key.

Create a component with a set of batch and .reg files:
Start.bat file under \Documents and Settings\All Users\Start
Menu\Programs\Startup directory.
Place the following files anywhere on target (e.g. under root):
User1.bat, User1.reg - user1 specifics (files, registry settings,
etc.);
AutologinUser1.reg - a reg. file to set User1 autologin;
User2.bat, User2.reg - user2 specifics (files, registry settings,
etc.);
AutologinUser2.reg - a reg. file to set User1 autologin;
Administrator.bat, Administrator.reg - - user2 specifics (files,
registry settings, etc.);
AutologinAdministrator.reg - a reg. file to set Administrator
autologin;
ClearAutologin.reg - a reg. file to clear autologin registry
settings;
(You may add the files to your image with TD Extra Files feature but making
your own component would separate your user account setup logic).

Autologin<User>.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"="<User>"
"DefaultPassword"="<User Password>"
"ForceAutoLogon"="1"
"AutoAdminLogon"="1"
"AutoLogonUser"="<User>"

ClearAutologin.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"=""
"DefaultPassword"=""
"ForceAutoLogon"="0"
"AutoAdminLogon"="0"
"AutoLogonUser"=""

<User>.reg may include any user account specific registry setting depending
on your needs.
<User>.bat files should include:
regedit.exe /s \<User>.reg
del /Q \<User>.reg
+ any user specific logic.

In TD you set "Automatic Logon" settings to log in to any of the user
accounts (e.g. User1). If you set it to User1, you won't need
AutologinUser1.reg.

The Start.bat file should be very simple and make calls to user batch files.
Start.bat:
IF EXIST \User1.bat (
call User1.bat
del /Q User1.bat
regedit.exe /s \AutologinUser2.reg
del /Q \AutologinUser2.reg
goto RESTART
)
IF EXIST \User2.bat (
call User2.bat
del /Q User2.bat
regedit.exe /s \AutologinAdministrator.reg
del /Q \AutologinAdministrator.reg
goto RESTART
)
IF EXIST \Administrator.bat (
call Administrator.bat
del /Q Administrator.bat
regedit.exe /s \ClearAutologin.reg
)
shutdown.exe /f /r /t 03
del /Q "\Documents and Settings\All Users\Start
Menu\Programs\Startup\Start.bat"
goto NOTHING
:RESTART
REM restart...
shutdown.exe /f /r /t 03
:NOTHING

Change Start.bat file to add/remove/modify anything that may be necessary to
meet your project requirements.
You don't necessary need to reboot your device each time you switch the user
but rather to log off (there might be sometimes a need to reboot the device
depending on the user settings you are trying to preset). To log off, change
shutdown call to "shutdown.exe /f /l /t 03".
Also, at the end of the Start.bat file (just before cleaning up itself) you
may change user account rights settings using an appropriate command line
tool from NT/2K/XP Resource Kits (e.g. cusrmgr.exe, ntrights, etc.).
And last hint - you may use reg.exe instead of set of the .reg files.

After the last reboot (log off) device is setup and ready.

Hope this helps,
KM,
BSquare Corp.

hello KM,

today was my lucky day. thanks to you, after many days of trying to
accomplish this, it finaly seems it's going the right way..

i made a batch file and set it in the HKLM....\RunOnceEx registry...
now it sets everything for ONE user.

but how do I have to automate it in the batch file so that
he does it for the other users?
it's not so clear how you do it with that "autologon" always like you
described...
(do you let the batch file logoff and logon maybe?)
(or when the autologon-key changes, does the system saves the HKCU
settings

automatically?)
seems all very complicated

is it maybe possible to post your code of your bat files?
it would be a great help for me to accomplish my final school project,

anyway,
thanks in advance!





to

image

Tool

under

particular

file

painful

image

components).
 
K

KM

Davide,

Yes, you are right - "reg /LOAD" is very useful feature and I considered it
at that time. However, when you do "reg /load" you only get a new root
subkey and you can't user HKEY_CURRENT_USER for loaded ntuser.dat.
In my case and scenario all the User settings were application registry
values, windows and Explorer policies, etc. They were mostly similar (and
sometimes dynamicly created) and I did not want to change HKCU to some other
key names.

Anyway, you are right. And instead of logoffs/reboots it may be easier to
use "reg /load", change all the User?.reg files and use Autologon only one
time.

KM
Hi all,
Please excuse my remark, but why reboot (or log off) the machine for
each user?
I think that doing a 'reg /LOAD' for each ntuser.dat user specific file
could be less 'time consuming' and do the trick anyway.

Defcon31,

I did not use RunOnceEx for the purpose of setting up user accounts. Using
StartUp batch files appeared to be more clear to accomplish that. However,
all the ugly logic you will see below may be implemented through the
RunOnce[Ex] key.
My batch files are full of info you don't need for your project, they have
got my project's specifics so they won't do much for you.
However, there is nothing smart in the batch files and it is easy to repro
the basic logic here. I'll discribe the scenario:

Assumptions:
Regedit.exe in your image (or reg.exe) ("Registry Editor" component);
XP shutdown.exe in your image (Software : System : System Services :
Base : "Misc. Command Line Tools" component);
"Automatic Logon" component in your image (or you change Autologin
registry values directly);
"Administrator account" and a couple of "User Account" (User 1, User2)
components are in your image. The account properties are set accordingly to
your needs (user groups, password, etc.);
User account group rights enough to modify [HKLM\..\Winlogon] registry
key.

Create a component with a set of batch and .reg files:
Start.bat file under \Documents and Settings\All Users\Start
Menu\Programs\Startup directory.
Place the following files anywhere on target (e.g. under root):
User1.bat, User1.reg - user1 specifics (files, registry settings,
etc.);
AutologinUser1.reg - a reg. file to set User1 autologin;
User2.bat, User2.reg - user2 specifics (files, registry settings,
etc.);
AutologinUser2.reg - a reg. file to set User1 autologin;
Administrator.bat, Administrator.reg - - user2 specifics (files,
registry settings, etc.);
AutologinAdministrator.reg - a reg. file to set Administrator
autologin;
ClearAutologin.reg - a reg. file to clear autologin registry
settings;
(You may add the files to your image with TD Extra Files feature but making
your own component would separate your user account setup logic).

Autologin<User>.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"="<User>"
"DefaultPassword"="<User Password>"
"ForceAutoLogon"="1"
"AutoAdminLogon"="1"
"AutoLogonUser"="<User>"

ClearAutologin.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"=""
"DefaultPassword"=""
"ForceAutoLogon"="0"
"AutoAdminLogon"="0"
"AutoLogonUser"=""

<User>.reg may include any user account specific registry setting depending
on your needs.
<User>.bat files should include:
regedit.exe /s \<User>.reg
del /Q \<User>.reg
+ any user specific logic.

In TD you set "Automatic Logon" settings to log in to any of the user
accounts (e.g. User1). If you set it to User1, you won't need
AutologinUser1.reg.

The Start.bat file should be very simple and make calls to user batch files.
Start.bat:
IF EXIST \User1.bat (
call User1.bat
del /Q User1.bat
regedit.exe /s \AutologinUser2.reg
del /Q \AutologinUser2.reg
goto RESTART
)
IF EXIST \User2.bat (
call User2.bat
del /Q User2.bat
regedit.exe /s \AutologinAdministrator.reg
del /Q \AutologinAdministrator.reg
goto RESTART
)
IF EXIST \Administrator.bat (
call Administrator.bat
del /Q Administrator.bat
regedit.exe /s \ClearAutologin.reg
)
shutdown.exe /f /r /t 03
del /Q "\Documents and Settings\All Users\Start
Menu\Programs\Startup\Start.bat"
goto NOTHING
:RESTART
REM restart...
shutdown.exe /f /r /t 03
:NOTHING

Change Start.bat file to add/remove/modify anything that may be necessary to
meet your project requirements.
You don't necessary need to reboot your device each time you switch the user
but rather to log off (there might be sometimes a need to reboot the device
depending on the user settings you are trying to preset). To log off, change
shutdown call to "shutdown.exe /f /l /t 03".
Also, at the end of the Start.bat file (just before cleaning up itself) you
may change user account rights settings using an appropriate command line
tool from NT/2K/XP Resource Kits (e.g. cusrmgr.exe, ntrights, etc.).
And last hint - you may use reg.exe instead of set of the .reg files.

After the last reboot (log off) device is setup and ready.

Hope this helps,
KM,
BSquare Corp.

hello KM,

today was my lucky day. thanks to you, after many days of trying to
accomplish this, it finaly seems it's going the right way..

i made a batch file and set it in the HKLM....\RunOnceEx registry...
now it sets everything for ONE user.

but how do I have to automate it in the batch file so that
he does it for the other users?
it's not so clear how you do it with that "autologon" always like you
described...
(do you let the batch file logoff and logon maybe?)
(or when the autologon-key changes, does the system saves the HKCU
settings

automatically?)
seems all very complicated

is it maybe possible to post your code of your bat files?
it would be a great help for me to accomplish my final school project,

anyway,
thanks in advance!





Defcon31,

I am wondering why you can't use FBA reseal mode? If you set fbareaseal
to

launch manually, you can prepeare your runtime image - create and set up
your user accounts as necessary, then manually reseal it and use the
image

as your golden image to be copied on to all devices. If you need unique
device names, SIDs and etc., you will have to include System Cloning
Tool

component (check XPe docs).

My problem was that I had to automate the setup anyway. So, I ended up
creating a set of batch and .reg files that were self-managed to run
under

a

few user accounts. After FBA I was using Autologon to log in to
particular

user and run a batch file as a All Users/Startup item. Then the batch
file

was switching Autologon registry settings to another user, cleaning up
itself and making another batch file as a All User/Startup item. This
scenerio was continueing until all the users were setup. This is a
painful

process when you do that first time but when the logic is set up and
understood, it is becoming eaiser to add new things (new files, new
accounts, new settings). Also, I did not have to manually setup the
image

each time I changed TD configuration (added/removed/modified
components).

Automating post-FBA phase was laso very helpful for image testing and
reproducing purposes (no human errors).

So, answering your questions - I was using All Users (Default

User)/Startup

items to launch batch files and import .reg files. I used
RunOnceEx/RunOnce/Run only to register (launch) all user specifics.

You may also use many useful utilities from XP (Win2000) Resource Kit
including cals, cusermgr, ntrights, etc to help yourself to automate the
procedure.

KM,
BSquare Corp.


i had the same solution in my mind

but do you how do you let that bat-file be executed?
- do you let execute the right bat files yourself ?
- or by setting it in a RunOnceEx key?
and in the second case, in which registry key do you set the
right RunOnces for different users?

thanks in advance !!!!




Defcon31,

I had a similar problem and I fixed that by using Autologon feature

and

a

set of batch files that set up necessary registry, desktop shortcuts

and

etc. on first account logons. The implementation required a few
logoff/logons after FBA was finished. The final batch file was

cleaning

up

all temporary files/settings from device and leaving necesary logon
settings.

KM,
Bsquare Corp.


hello,

i have an administrator account and two user accounts.

1)how can i set a different wallpaper for each of them?

2)how can i create different desktop shortcuts for them?

anyone has experience with this so that everything is being fixed

during

FBA.

thanks in advance
 
D

Defcon31

Thanks KM it works great,
..... almost.... still one thing that is a problem...

i let first logon as admin and it does everything correct,
but when i do then autologon as User and the batch file proceeds the
registry settings,
there are some registry settings that user cannot alter in "HKCU", like its
policies, and even the Run-key.

what now?



KM said:
Davide,

Yes, you are right - "reg /LOAD" is very useful feature and I considered it
at that time. However, when you do "reg /load" you only get a new root
subkey and you can't user HKEY_CURRENT_USER for loaded ntuser.dat.
In my case and scenario all the User settings were application registry
values, windows and Explorer policies, etc. They were mostly similar (and
sometimes dynamicly created) and I did not want to change HKCU to some other
key names.

Anyway, you are right. And instead of logoffs/reboots it may be easier to
use "reg /load", change all the User?.reg files and use Autologon only one
time.

KM
Hi all,
Please excuse my remark, but why reboot (or log off) the machine for
each user?
I think that doing a 'reg /LOAD' for each ntuser.dat user specific file
could be less 'time consuming' and do the trick anyway.

Defcon31,

I did not use RunOnceEx for the purpose of setting up user accounts. Using
StartUp batch files appeared to be more clear to accomplish that. However,
all the ugly logic you will see below may be implemented through the
RunOnce[Ex] key.
My batch files are full of info you don't need for your project, they have
got my project's specifics so they won't do much for you.
However, there is nothing smart in the batch files and it is easy to repro
the basic logic here. I'll discribe the scenario:

Assumptions:
Regedit.exe in your image (or reg.exe) ("Registry Editor" component);
XP shutdown.exe in your image (Software : System : System Services :
Base : "Misc. Command Line Tools" component);
"Automatic Logon" component in your image (or you change Autologin
registry values directly);
"Administrator account" and a couple of "User Account" (User 1, User2)
components are in your image. The account properties are set
accordingly
to
your needs (user groups, password, etc.);
User account group rights enough to modify [HKLM\..\Winlogon] registry
key.

Create a component with a set of batch and .reg files:
Start.bat file under \Documents and Settings\All Users\Start
Menu\Programs\Startup directory.
Place the following files anywhere on target (e.g. under root):
User1.bat, User1.reg - user1 specifics (files, registry settings,
etc.);
AutologinUser1.reg - a reg. file to set User1 autologin;
User2.bat, User2.reg - user2 specifics (files, registry settings,
etc.);
AutologinUser2.reg - a reg. file to set User1 autologin;
Administrator.bat, Administrator.reg - - user2 specifics (files,
registry settings, etc.);
AutologinAdministrator.reg - a reg. file to set Administrator
autologin;
ClearAutologin.reg - a reg. file to clear autologin registry
settings;
(You may add the files to your image with TD Extra Files feature but making
your own component would separate your user account setup logic).

Autologin<User>.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"="<User>"
"DefaultPassword"="<User Password>"
"ForceAutoLogon"="1"
"AutoAdminLogon"="1"
"AutoLogonUser"="<User>"

ClearAutologin.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"=""
"DefaultPassword"=""
"ForceAutoLogon"="0"
"AutoAdminLogon"="0"
"AutoLogonUser"=""

<User>.reg may include any user account specific registry setting depending
on your needs.
<User>.bat files should include:
regedit.exe /s \<User>.reg
del /Q \<User>.reg
+ any user specific logic.

In TD you set "Automatic Logon" settings to log in to any of the user
accounts (e.g. User1). If you set it to User1, you won't need
AutologinUser1.reg.

The Start.bat file should be very simple and make calls to user batch files.
Start.bat:
IF EXIST \User1.bat (
call User1.bat
del /Q User1.bat
regedit.exe /s \AutologinUser2.reg
del /Q \AutologinUser2.reg
goto RESTART
)
IF EXIST \User2.bat (
call User2.bat
del /Q User2.bat
regedit.exe /s \AutologinAdministrator.reg
del /Q \AutologinAdministrator.reg
goto RESTART
)
IF EXIST \Administrator.bat (
call Administrator.bat
del /Q Administrator.bat
regedit.exe /s \ClearAutologin.reg
)
shutdown.exe /f /r /t 03
del /Q "\Documents and Settings\All Users\Start
Menu\Programs\Startup\Start.bat"
goto NOTHING
:RESTART
REM restart...
shutdown.exe /f /r /t 03
:NOTHING

Change Start.bat file to add/remove/modify anything that may be necessary to
meet your project requirements.
You don't necessary need to reboot your device each time you switch
the
itself)
 
S

Slobodan Brcin

Make all users as admins.

Then make app that will be called from batch after you set all parameters.
And since you have admin privileges your app can switch privileges for
current user to privileges you want.


Regards,
Slobodan


Defcon31 said:
Thanks KM it works great,
.... almost.... still one thing that is a problem...

i let first logon as admin and it does everything correct,
but when i do then autologon as User and the batch file proceeds the
registry settings,
there are some registry settings that user cannot alter in "HKCU", like its
policies, and even the Run-key.

what now?



KM said:
Davide,

Yes, you are right - "reg /LOAD" is very useful feature and I considered it
at that time. However, when you do "reg /load" you only get a new root
subkey and you can't user HKEY_CURRENT_USER for loaded ntuser.dat.
In my case and scenario all the User settings were application registry
values, windows and Explorer policies, etc. They were mostly similar (and
sometimes dynamicly created) and I did not want to change HKCU to some other
key names.

Anyway, you are right. And instead of logoffs/reboots it may be easier to
use "reg /load", change all the User?.reg files and use Autologon only one
time.

KM
Hi all,
Please excuse my remark, but why reboot (or log off) the machine for
each user?
I think that doing a 'reg /LOAD' for each ntuser.dat user specific file
could be less 'time consuming' and do the trick anyway.


KM wrote:

Defcon31,

I did not use RunOnceEx for the purpose of setting up user accounts. Using
StartUp batch files appeared to be more clear to accomplish that. However,
all the ugly logic you will see below may be implemented through the
RunOnce[Ex] key.
My batch files are full of info you don't need for your project,
they
have
got my project's specifics so they won't do much for you.
However, there is nothing smart in the batch files and it is easy to repro
the basic logic here. I'll discribe the scenario:

Assumptions:
Regedit.exe in your image (or reg.exe) ("Registry Editor" component);
XP shutdown.exe in your image (Software : System : System
Services
:
Base : "Misc. Command Line Tools" component);
"Automatic Logon" component in your image (or you change Autologin
registry values directly);
"Administrator account" and a couple of "User Account" (User 1, User2)
components are in your image. The account properties are set
accordingly
to
your needs (user groups, password, etc.);
User account group rights enough to modify [HKLM\..\Winlogon] registry
key.

Create a component with a set of batch and .reg files:
Start.bat file under \Documents and Settings\All Users\Start
Menu\Programs\Startup directory.
Place the following files anywhere on target (e.g. under root):
User1.bat, User1.reg - user1 specifics (files, registry settings,
etc.);
AutologinUser1.reg - a reg. file to set User1 autologin;
User2.bat, User2.reg - user2 specifics (files, registry settings,
etc.);
AutologinUser2.reg - a reg. file to set User1 autologin;
Administrator.bat, Administrator.reg - - user2 specifics (files,
registry settings, etc.);
AutologinAdministrator.reg - a reg. file to set Administrator
autologin;
ClearAutologin.reg - a reg. file to clear autologin registry
settings;
(You may add the files to your image with TD Extra Files feature but making
your own component would separate your user account setup logic).

Autologin<User>.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"="<User>"
"DefaultPassword"="<User Password>"
"ForceAutoLogon"="1"
"AutoAdminLogon"="1"
"AutoLogonUser"="<User>"

ClearAutologin.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"=""
"DefaultPassword"=""
"ForceAutoLogon"="0"
"AutoAdminLogon"="0"
"AutoLogonUser"=""

<User>.reg may include any user account specific registry setting depending
on your needs.
<User>.bat files should include:
regedit.exe /s \<User>.reg
del /Q \<User>.reg
+ any user specific logic.

In TD you set "Automatic Logon" settings to log in to any of the user
accounts (e.g. User1). If you set it to User1, you won't need
AutologinUser1.reg.

The Start.bat file should be very simple and make calls to user
batch
files.
Start.bat:
IF EXIST \User1.bat (
call User1.bat
del /Q User1.bat
regedit.exe /s \AutologinUser2.reg
del /Q \AutologinUser2.reg
goto RESTART
)
IF EXIST \User2.bat (
call User2.bat
del /Q User2.bat
regedit.exe /s \AutologinAdministrator.reg
del /Q \AutologinAdministrator.reg
goto RESTART
)
IF EXIST \Administrator.bat (
call Administrator.bat
del /Q Administrator.bat
regedit.exe /s \ClearAutologin.reg
)
shutdown.exe /f /r /t 03
del /Q "\Documents and Settings\All Users\Start
Menu\Programs\Startup\Start.bat"
goto NOTHING
:RESTART
REM restart...
shutdown.exe /f /r /t 03
:NOTHING

Change Start.bat file to add/remove/modify anything that may be necessary to
meet your project requirements.
You don't necessary need to reboot your device each time you switch
the
user
but rather to log off (there might be sometimes a need to reboot the device
depending on the user settings you are trying to preset). To log
off,
change
shutdown call to "shutdown.exe /f /l /t 03".
Also, at the end of the Start.bat file (just before cleaning up
itself)
you
may change user account rights settings using an appropriate command line
tool from NT/2K/XP Resource Kits (e.g. cusrmgr.exe, ntrights, etc.).
And last hint - you may use reg.exe instead of set of the .reg files.

After the last reboot (log off) device is setup and ready.

Hope this helps,
KM,
BSquare Corp.


hello KM,

today was my lucky day. thanks to you, after many days of trying to
accomplish this, it finaly seems it's going the right way..

i made a batch file and set it in the HKLM....\RunOnceEx registry...
now it sets everything for ONE user.

but how do I have to automate it in the batch file so that
he does it for the other users?
it's not so clear how you do it with that "autologon" always like you
described...
(do you let the batch file logoff and logon maybe?)
(or when the autologon-key changes, does the system saves the HKCU

settings

automatically?)
seems all very complicated

is it maybe possible to post your code of your bat files?
it would be a great help for me to accomplish my final school project,

anyway,
thanks in advance!





Defcon31,

I am wondering why you can't use FBA reseal mode? If you set fbareaseal

to

launch manually, you can prepeare your runtime image - create and
set
up
your user accounts as necessary, then manually reseal it and use the

image

as your golden image to be copied on to all devices. If you need unique
device names, SIDs and etc., you will have to include System Cloning

Tool

component (check XPe docs).

My problem was that I had to automate the setup anyway. So, I ended up
creating a set of batch and .reg files that were self-managed to run

under

a

few user accounts. After FBA I was using Autologon to log in to

particular

user and run a batch file as a All Users/Startup item. Then the batch

file

was switching Autologon registry settings to another user, cleaning up
itself and making another batch file as a All User/Startup item. This
scenerio was continueing until all the users were setup. This is a

painful

process when you do that first time but when the logic is set up and
understood, it is becoming eaiser to add new things (new files, new
accounts, new settings). Also, I did not have to manually setup the

image

each time I changed TD configuration (added/removed/modified

components).

Automating post-FBA phase was laso very helpful for image testing and
reproducing purposes (no human errors).

So, answering your questions - I was using All Users (Default

User)/Startup

items to launch batch files and import .reg files. I used
RunOnceEx/RunOnce/Run only to register (launch) all user specifics.

You may also use many useful utilities from XP (Win2000) Resource Kit
including cals, cusermgr, ntrights, etc to help yourself to
automate
the
procedure.

KM,
BSquare Corp.


i had the same solution in my mind

but do you how do you let that bat-file be executed?
- do you let execute the right bat files yourself ?
- or by setting it in a RunOnceEx key?
and in the second case, in which registry key do you set the
right RunOnces for different users?

thanks in advance !!!!




Defcon31,

I had a similar problem and I fixed that by using Autologon feature

and

a

set of batch files that set up necessary registry, desktop shortcuts

and

etc. on first account logons. The implementation required a few
logoff/logons after FBA was finished. The final batch file was

cleaning

up

all temporary files/settings from device and leaving necesary logon
settings.

KM,
Bsquare Corp.


hello,

i have an administrator account and two user accounts.

1)how can i set a different wallpaper for each of them?

2)how can i create different desktop shortcuts for them?

anyone has experience with this so that everything is being fixed

during

FBA.

thanks in advance
 
K

KM

Defcon31,

For your user accounts in TD use a group that provides rights enough to
modify [HKLM] abd [HKCU] registries. Administrator group would be the best
(I used that on my device).

From my previous post in this thread: "Also, at the end of the Start.bat
file (just before cleaning up itself) you
may change user account rights settings using an appropriate command line
tool from NT/2K/XP Resource Kits (e.g. cusrmgr.exe, ntrights, etc.)."
That means you may change the groups that the users belong to at runtime as
a last step in your setup. If you don't want to do that programmatically,
you may find a lot of related command line tools on Internet. My favorite
utility is cusrmgr.exe (Console User Manager) from Win2K Resource Kit (you
may also find and download it from Internet). Here is more info on the tool:
http://support.microsoft.com/defaul...port/kb/articles/Q272/5/30.ASP&NoWebContent=1.
Look into local Group Functions: -alg, -dlg.

Good luck,
KM
Thanks KM it works great,
.... almost.... still one thing that is a problem...

i let first logon as admin and it does everything correct,
but when i do then autologon as User and the batch file proceeds the
registry settings,
there are some registry settings that user cannot alter in "HKCU", like its
policies, and even the Run-key.

what now?



KM said:
Davide,

Yes, you are right - "reg /LOAD" is very useful feature and I considered it
at that time. However, when you do "reg /load" you only get a new root
subkey and you can't user HKEY_CURRENT_USER for loaded ntuser.dat.
In my case and scenario all the User settings were application registry
values, windows and Explorer policies, etc. They were mostly similar (and
sometimes dynamicly created) and I did not want to change HKCU to some other
key names.

Anyway, you are right. And instead of logoffs/reboots it may be easier to
use "reg /load", change all the User?.reg files and use Autologon only one
time.

KM
Hi all,
Please excuse my remark, but why reboot (or log off) the machine for
each user?
I think that doing a 'reg /LOAD' for each ntuser.dat user specific file
could be less 'time consuming' and do the trick anyway.


KM wrote:

Defcon31,

I did not use RunOnceEx for the purpose of setting up user accounts. Using
StartUp batch files appeared to be more clear to accomplish that. However,
all the ugly logic you will see below may be implemented through the
RunOnce[Ex] key.
My batch files are full of info you don't need for your project,
they
have
got my project's specifics so they won't do much for you.
However, there is nothing smart in the batch files and it is easy to repro
the basic logic here. I'll discribe the scenario:

Assumptions:
Regedit.exe in your image (or reg.exe) ("Registry Editor" component);
XP shutdown.exe in your image (Software : System : System
Services
:
Base : "Misc. Command Line Tools" component);
"Automatic Logon" component in your image (or you change Autologin
registry values directly);
"Administrator account" and a couple of "User Account" (User 1, User2)
components are in your image. The account properties are set
accordingly
to
your needs (user groups, password, etc.);
User account group rights enough to modify [HKLM\..\Winlogon] registry
key.

Create a component with a set of batch and .reg files:
Start.bat file under \Documents and Settings\All Users\Start
Menu\Programs\Startup directory.
Place the following files anywhere on target (e.g. under root):
User1.bat, User1.reg - user1 specifics (files, registry settings,
etc.);
AutologinUser1.reg - a reg. file to set User1 autologin;
User2.bat, User2.reg - user2 specifics (files, registry settings,
etc.);
AutologinUser2.reg - a reg. file to set User1 autologin;
Administrator.bat, Administrator.reg - - user2 specifics (files,
registry settings, etc.);
AutologinAdministrator.reg - a reg. file to set Administrator
autologin;
ClearAutologin.reg - a reg. file to clear autologin registry
settings;
(You may add the files to your image with TD Extra Files feature but making
your own component would separate your user account setup logic).

Autologin<User>.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"="<User>"
"DefaultPassword"="<User Password>"
"ForceAutoLogon"="1"
"AutoAdminLogon"="1"
"AutoLogonUser"="<User>"

ClearAutologin.reg files should look like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
"DefaultUserName"=""
"DefaultPassword"=""
"ForceAutoLogon"="0"
"AutoAdminLogon"="0"
"AutoLogonUser"=""

<User>.reg may include any user account specific registry setting depending
on your needs.
<User>.bat files should include:
regedit.exe /s \<User>.reg
del /Q \<User>.reg
+ any user specific logic.

In TD you set "Automatic Logon" settings to log in to any of the user
accounts (e.g. User1). If you set it to User1, you won't need
AutologinUser1.reg.

The Start.bat file should be very simple and make calls to user
batch
files.
Start.bat:
IF EXIST \User1.bat (
call User1.bat
del /Q User1.bat
regedit.exe /s \AutologinUser2.reg
del /Q \AutologinUser2.reg
goto RESTART
)
IF EXIST \User2.bat (
call User2.bat
del /Q User2.bat
regedit.exe /s \AutologinAdministrator.reg
del /Q \AutologinAdministrator.reg
goto RESTART
)
IF EXIST \Administrator.bat (
call Administrator.bat
del /Q Administrator.bat
regedit.exe /s \ClearAutologin.reg
)
shutdown.exe /f /r /t 03
del /Q "\Documents and Settings\All Users\Start
Menu\Programs\Startup\Start.bat"
goto NOTHING
:RESTART
REM restart...
shutdown.exe /f /r /t 03
:NOTHING

Change Start.bat file to add/remove/modify anything that may be necessary to
meet your project requirements.
You don't necessary need to reboot your device each time you switch
the
user
but rather to log off (there might be sometimes a need to reboot the device
depending on the user settings you are trying to preset). To log
off,
change
shutdown call to "shutdown.exe /f /l /t 03".
Also, at the end of the Start.bat file (just before cleaning up
itself)
you
may change user account rights settings using an appropriate command line
tool from NT/2K/XP Resource Kits (e.g. cusrmgr.exe, ntrights, etc.).
And last hint - you may use reg.exe instead of set of the .reg files.

After the last reboot (log off) device is setup and ready.

Hope this helps,
KM,
BSquare Corp.


hello KM,

today was my lucky day. thanks to you, after many days of trying to
accomplish this, it finaly seems it's going the right way..

i made a batch file and set it in the HKLM....\RunOnceEx registry...
now it sets everything for ONE user.

but how do I have to automate it in the batch file so that
he does it for the other users?
it's not so clear how you do it with that "autologon" always like you
described...
(do you let the batch file logoff and logon maybe?)
(or when the autologon-key changes, does the system saves the HKCU

settings

automatically?)
seems all very complicated

is it maybe possible to post your code of your bat files?
it would be a great help for me to accomplish my final school project,

anyway,
thanks in advance!





Defcon31,

I am wondering why you can't use FBA reseal mode? If you set fbareaseal

to

launch manually, you can prepeare your runtime image - create and
set
up
your user accounts as necessary, then manually reseal it and use the

image

as your golden image to be copied on to all devices. If you need unique
device names, SIDs and etc., you will have to include System Cloning

Tool

component (check XPe docs).

My problem was that I had to automate the setup anyway. So, I ended up
creating a set of batch and .reg files that were self-managed to run

under

a

few user accounts. After FBA I was using Autologon to log in to

particular

user and run a batch file as a All Users/Startup item. Then the batch

file

was switching Autologon registry settings to another user, cleaning up
itself and making another batch file as a All User/Startup item. This
scenerio was continueing until all the users were setup. This is a

painful

process when you do that first time but when the logic is set up and
understood, it is becoming eaiser to add new things (new files, new
accounts, new settings). Also, I did not have to manually setup the

image

each time I changed TD configuration (added/removed/modified

components).

Automating post-FBA phase was laso very helpful for image testing and
reproducing purposes (no human errors).

So, answering your questions - I was using All Users (Default

User)/Startup

items to launch batch files and import .reg files. I used
RunOnceEx/RunOnce/Run only to register (launch) all user specifics.

You may also use many useful utilities from XP (Win2000) Resource Kit
including cals, cusermgr, ntrights, etc to help yourself to
automate
the
procedure.

KM,
BSquare Corp.


i had the same solution in my mind

but do you how do you let that bat-file be executed?
- do you let execute the right bat files yourself ?
- or by setting it in a RunOnceEx key?
and in the second case, in which registry key do you set the
right RunOnces for different users?

thanks in advance !!!!




Defcon31,

I had a similar problem and I fixed that by using Autologon feature

and

a

set of batch files that set up necessary registry, desktop shortcuts

and

etc. on first account logons. The implementation required a few
logoff/logons after FBA was finished. The final batch file was

cleaning

up

all temporary files/settings from device and leaving necesary logon
settings.

KM,
Bsquare Corp.


hello,

i have an administrator account and two user accounts.

1)how can i set a different wallpaper for each of them?

2)how can i create different desktop shortcuts for them?

anyone has experience with this so that everything is being fixed

during

FBA.

thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top