Using Logon Script for User Profile

G

Guest

Hi,

I am having trouble understanding why the logon script in Windows XP doesn't
work when it operates correctlt if I run it in a command prompt.

I need to execute a logon script on a stand-alone PC which will delay start
up until some system services are running. Then I call up an application
which uses these services. The problem is that the line I use:

sleep 60

is not being executed and therefore the application is running before the
service is running, causing problems.

My question is: why dows this not work when it is a logon script? and/or is
there a better way to do it? and/or is there a way to determine if the
service is running and therefore hold off on running the application until it
is?

Any help or guidance will be greatly appreciated.
 
P

Pegasus \(MVP\)

ahalford said:
Hi,

I am having trouble understanding why the logon script in Windows XP doesn't
work when it operates correctlt if I run it in a command prompt.

I need to execute a logon script on a stand-alone PC which will delay start
up until some system services are running. Then I call up an application
which uses these services. The problem is that the line I use:

sleep 60

is not being executed and therefore the application is running before the
service is running, causing problems.

My question is: why dows this not work when it is a logon script? and/or is
there a better way to do it? and/or is there a way to determine if the
service is running and therefore hold off on running the application until it
is?

Any help or guidance will be greatly appreciated.

That's probably because "sleep.exe" is not in the path at
logon time! You can easily find out by modifying your
logon script like so:

@echo off
some lines of code . . .
echo on
echo Watch things now!
pause
sleep 60
pause

Now watch what happens and all will become clear!
I suspect you may have to code the script like so:

c:\Tools\sleep 60
 
G

Guest

Thanks Pegasus,

Unfortunately this did not fix the problem. I added the path to the sleep
command and it still did not execute. If I run the logon.bat file from a
command window after I am logged in it works perfectly, but not when it is
part of the logon batch file. I have tried calling a second batch file with
the sleep command in it to no avail. Does XP execute a logon batch file
differently to a regular batch file? i.e. does it use multiple threads to
execute faster, and if so is there a way to force to execute sequentially?

Thanks for your help

Andy
 

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