Asynchronous logon script environment

  • Thread starter Thread starter Tom Del Rosso
  • Start date Start date
T

Tom Del Rosso

If synchronous logon scripts run before environment variables are set,
asynchronous logon scripts aren't guaranteed to run after the environment
is set up either, right? So it would seem that a script should loop until
it sees values applied to the required variables. I don't think I've seen
this done though. Is it good practice?
 
Tom Del Rosso said:
If synchronous logon scripts run before environment variables are set,
asynchronous logon scripts aren't guaranteed to run after the environment
is set up either, right? So it would seem that a script should loop until
it sees values applied to the required variables. I don't think I've seen
this done though. Is it good practice?

I would think that environmental variables are set up a long,
long time before the logon script runs, synchronous or
otherwise. If you want the script to loop then you have to code
this yourself, e.g. like so:

:Loop
if not defined username goto Loop
 
Pegasus (MVP) said:
I would think that environmental variables are set up a long,
long time before the logon script runs, synchronous or
otherwise. If you want the script to loop then you have to code
this yourself, e.g. like so:

:Loop
if not defined username goto Loop

Then is this incorrect or did I misunderstand it? (From the very bottom of
this page:)

http://www.oreilly.com/catalog/win2000ads/chapter/ch08.html

"4. You can't run a logon script synchronously if it needs to interact with
the user's environment. Synchronous logon scripts will always finish prior
to environment variables being set and prior to the user's profile being
loaded."
 
Tom Del Rosso said:
Then is this incorrect or did I misunderstand it? (From the very bottom of
this page:)

http://www.oreilly.com/catalog/win2000ads/chapter/ch08.html

"4. You can't run a logon script synchronously if it needs to interact with
the user's environment. Synchronous logon scripts will always finish prior
to environment variables being set and prior to the user's profile being
loaded."

This site is a well-respected site. However, I would like to see this
with my own eyes before I believe it, because it just does not
sound right. The phrase "finish prior" is certainly wrong: A script
can run for quite some time, and since it runs synchronously with
other things, it may finish well after the environmental variables
have been set.
 
Pegasus (MVP) said:
This site is a well-respected site. However, I would like to see this
with my own eyes before I believe it, because it just does not
sound right. The phrase "finish prior" is certainly wrong: A script
can run for quite some time, and since it runs synchronously with
other things, it may finish well after the environmental variables
have been set.

Then what can be said of the execution sequence when it's synchronous, or
not? Is it correct that 2k and XP have opposite defaults on this?
 
Tom Del Rosso said:
Then what can be said of the execution sequence when it's synchronous, or
not? Is it correct that 2k and XP have opposite defaults on this?

The essence of synchronous vs. sequential execution is that with
sequential execution, the desktop becomes available only AFTER
the logon script has finished. With synchronous execution it
becomes available WHILE the logon script executes. The following
KB article gives you some information about the respective
defaults: http://support.microsoft.com/kb/q305293/
 
Pegasus (MVP) said:
The essence of synchronous vs. sequential execution is that with
sequential execution, the desktop becomes available only AFTER
the logon script has finished. With synchronous execution it
becomes available WHILE the logon script executes. The following
KB article gives you some information about the respective
defaults: http://support.microsoft.com/kb/q305293/

Aha, then by "synchronous" they mean concurrent or simultaneous. That's
very different from what I thought, because of the choice of words. To me,
"synchronous" implies that execution occurs in a controlled sequence based
on dependencies. Thank you.
 
Back
Top