[windows2000] Batch File Question

  • From: Mike Dillinger <miked@xxxxxxxxxxxxxx>
  • To: Windows 2000 <windows2000@xxxxxxxxxxxxx>
  • Date: Sat, 20 Sep 2003 14:40:37 -0700

Hello,

Here's my situation.  I know it's a little funky, but I have reasons for
doing it.

What I want to do is have a login BAT file run for a user.  I want to
specify a list of programs to run upon login.  Here's functionally what
I want to do (link to batch file is in the Startup folder):
- User login
- Run program A
- Run program B
- Run program C

I know there's the startup folder, but I'd like to run these in a
certain order.  One has to be loaded before the other, and I have to
pause/sleep for a bit between A, B, and C.

I have a batch file I wrote, but I'm doing one or both of these things
wrong:
- Make an array or variable list in Windows batch scripting
- Get the "for" loop to process

Here's pretty much what I got now (exact paths/filenames changed to
protect the innocent):
-----
@echo off

:: Variable definition
set ProgramA="C:\Program Files\proga.exe"
set ProgramB="C:\Program Files\progb.exe"
set ProgramC="C:\Program Files\progc.exe"
set ProgramsToRun=%ProgramA%;%ProgramB%;%ProgramC%
set Sleep="C:\Program Files\sleep.exe"

:: Run each program with a 30 second delay in between
for /f "delims=;" %%i in ( %ProgramsToRun% ) do (
   :: echo %%i
   %Sleep% 30
   START "" %%i
)
-----

Any help is greatly appreciated.  Thanks!
-MikeD


**********************************************************
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

Other related posts: