Solved

How to delay nt autologin or delay service

Posted on 2004-04-20
8
958 Views
Last Modified: 2013-12-28
The problem I have is I have an nt server 4.0 machine set to login automatically.  The problem is one of my 3rd party applications service fails at startup right after login.  The reason for this is the nt services have not fully started up and this application depends on the nt services to start before it can start.  IF I disable auto login the application service starts fine, this is because you get the login prompt now and it gives you an extra few secondsfor the nt services to start before my application services start.  I need to have autologin enabled though, this is just how they want it.  I tried the article "how to delay loading of specific services" Article - 193888 from microsoft, but the instructions to edit and add a value, etc are not an option when I go to services in the registry.  It says to add a new value name Depenonservice with data type of reg_multisz, but there is no option to pick a data type of that type.  I am using regedit, am I using the right registry editor?  Is there any way to delay this service at startup or to delay the autologin by a few seconds so it give the nt services time to start before my applications services start?
0
Comment
Question by:Janice1967
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 7

Expert Comment

by:YarnoSG
ID: 10870236
you are using the WRONG registry editor.

(not an issue in XP, but the registry editors have different capabilities in 2000 and Prior NT Based OSes.)  To generate a REG_MULTI_SZ in 2000 or NT4, you need to be using REGEDT32.
Reference http://support.microsoft.com/default.aspx?scid=kb;EN-US;141377
and an article I wrote 4+ years ago: http://www.winnetmag.com/Article/ArticleID/14738/14738.html
0
 
LVL 7

Expert Comment

by:YarnoSG
ID: 10870241
oh, and the article you had before will work if you use the right editor.....
0
 

Author Comment

by:Janice1967
ID: 10872132
Thanks,
I will try this.  I think the startup file that is failing at atartup is not a service now.  It is a .exe file that is failing. It is located in c:\winnt\profiles\all users\programs\start menu\startup\XXX.exe.  When I go into task manager I see XXX.exe and a PID for it.  It is not listed in the services in Windows nt diagnostics, does this mean it is not a service? If it is not a service then I cannot use the article I mentioned above.  If it is not a service how can I delay this file from running until all the nt services have started.
0
 

Expert Comment

by:jzanette
ID: 10872329
You could put the startup commands in a script and then use

   CALL ntlib.cmd /init
   %.Wait% [SecondsToWait]
   YourExeHere

*******

The Advanced Command Library (ntlib.cmd) is free at http://ntlib.com, and includes the .Wait command used in the example.

ntlib.cmd contains NO BINARY CODE, just shell scripting commands.  It runs CONSISTENTLY on NT4SP6a+, 2000, XP and Server 2003.

0
Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

 
LVL 4

Expert Comment

by:averyb
ID: 10934847
If you have access to WinNt Server Resource Kit there are two files you need.  InstSrv.Exe and SrvAny.exe  These two files will let you install any exe as a Service.  

MS Knowledge Base Article 137890

It is rock-solid, and I have used it extensively.
0
 
LVL 4

Accepted Solution

by:
averyb earned 125 total points
ID: 10934862
You could also use sleep.exe form the Resource Kit.  Make a bat file that calls your exe file and enter sleep 30 on the line before the exe command.  That will cause a 30 second pause in the bat file before the next line is read in the bat file.

Using Instsrv and Srvany is a much more elegant way.
0
 

Author Comment

by:Janice1967
ID: 10938832
I created a batch file which called my .exe file and entered sleep 7.  It worked perfectly.  
0
 
LVL 4

Expert Comment

by:averyb
ID: 10945016
Glad it worked.  Using srvany and instsrv will allow you to control the program like a regular NT service from the control panel, services applet or the cmd line.
0

Featured Post

Can’t get the mobile email signature right?

Not having any luck when trying to create an email signature for mobile devices? Does the formatting keep messing up? Make sure you have great email signatures on all devices by using Exclaimer Cloud - Signatures for Office 365.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Several part series to implement Internet Explorer 11 Enterprise Mode
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now