How to delay an application from launching after startup?

L

lkqwsr

Hi.

I have a user who experiences strange errors whenever a certain
application is in the startup folder. If the user waits until after
everything else has loaded and then launches the app separately, the
application runs fine and doesn't cause any problems. Unfortunately,
the user does not usually manually launch the app. I'm looking for ways
to have it still start up automatically but load after everything else
has loaded, in the hopes that this will resolve the problems. Note that
we're on Windows XP Pro SP2.

I'm guessing I can do this via a login script, but note that the user
has a laptop and is commonly not on the company network, and I'm also
concerned that maybe it needs to load after the login script has
finished executing.

I was told by a Microsoft tech support rep that I could change the
order of startup items via msconfig, but then he couldn't tell me how
to do that and I couldn't figure out how to do it myself.

I'd like to delay the application's launch maybe three minutes after
everything else has loaded.

I haven't written a batch file in a while, and I'm wondering whether
you can even do them in XP. If so, I could put it in startup and just
have it wait for a few minutes (right?), then call the application I
want it to launch?

Any ideas on the subject would be appreciated.

Thanks.
Mark
 
T

Torgeir Bakken \(MVP\)

Hi,

Yes, you can use a batch file (.bat or .cmd) for this.

Here is an example batch file that waits 3 minutes before starting
Word:

-------------mystartup.cmd-------------
:: pause for about 3 minutes
ping.exe -n 181 127.0.0.1
start "" "C:\Program Files\Microsoft Office\OFFICE11\word.exe"
---------------end file------------------

For the ping command, the number behind -n is seconds you want to
"sleep" +1

127.0.0.1 is "localhost"


Myself, I would have used a VBScript (.vbs) instead, this way you
will e.g. not get a command prompt visible for three minutes.

Here is an example comparable to the batch file above:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")

' Program to launch
sFilePath = "C:\Program Files\Microsoft Office\OFFICE11\word.exe"

' Sleep for 3 minutes
WScript.Sleep 3 * 60 * 1000

' add quotes around the path in case of spaces
oShell.Run """" & sFilePath & """", 1, False

'--------------------8<----------------------


WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
 
B

billious

Hi.

I have a user who experiences strange errors whenever a certain
application is in the startup folder. If the user waits until after
everything else has loaded and then launches the app separately, the
application runs fine and doesn't cause any problems. Unfortunately,
the user does not usually manually launch the app. I'm looking for ways
to have it still start up automatically but load after everything else
has loaded, in the hopes that this will resolve the problems. Note that
we're on Windows XP Pro SP2.

I'm guessing I can do this via a login script, but note that the user
has a laptop and is commonly not on the company network, and I'm also
concerned that maybe it needs to load after the login script has
finished executing.

I was told by a Microsoft tech support rep that I could change the
order of startup items via msconfig, but then he couldn't tell me how
to do that and I couldn't figure out how to do it myself.

I'd like to delay the application's launch maybe three minutes after
everything else has loaded.

I haven't written a batch file in a while, and I'm wondering whether
you can even do them in XP. If so, I could put it in startup and just
have it wait for a few minutes (right?), then call the application I
want it to launch?

Any ideas on the subject would be appreciated.

Thanks.
Mark

Yes, Mark. Batch is still alive in XP. You can get to "DOS" by running
CMD.EXE (the command EXIT terminates the session.) Microsoft sycophants will
insist "there is no DOS" but if it walks like a duck and talks like a
duck....

I'd suggest you try using "AT" to start your application 3 minutes after
startup. Precisely how you'd do this depends on what your time-format is, as
batch will have to do some calculations on the current time to figure out
the start time for your mystery application.

Perhaps you could ask in the newsgroup alt.msdos.batch.nt - specifying the
format that your machine shows when you type "time/t" at the prompt - it's
conveniently configuration-dependent. I use 24-hour time format, which
solves all problems but some people have am/pm indicators and possibly
suppressed-zero hour display which adds in a few complications (ie at 09:30,
what does YOUR system say?)

With a few more items of data, this problem is easily solved.
alt.msdos.batch.nt is your key though.

HTH

....Bill
 

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