Hello all

I have written this script (shown below) that checks if an application is running and displays a dialog box to inform the user to close the application down.

Everything works fine except that I want to find a way to compact the part of the script that checks for each Application.

Does anybody have any suggestions as to how I could achieve this?

Thanks in advance

Kevin

Del "C:\Apps.txt"

Shell "%ComSpec% /c %WinDir%\Kill.exe >C:\Apps.txt"

$Programs = ""

$Result = Close(1)

If Open(1,"C:\Apps.txt") = 0

$App = ReadLine(1)

While @Error = 0

$App = Readline(1)

If Instr( $App , "WinWord.exe" )

$Programs = "$Programs" + "Microsoft Word" + $LineBreak

Endif


If Instr( $App , "Excel.exe" )

$Programs = "$Programs" + "Microsoft Excel" + $LineBreak

Endif


If Instr( $App , "PowerPnt.exe" )

$Programs = "$Programs" + "Microsoft PowerPoint" + $LineBreak

Endif


If Instr( $App , "MSAccess.exe" )

$Programs = "$Programs" + "Microsoft Access" + $LineBreak

Endif


If Instr( $App , "IExplore.exe" )

$Programs = "$Programs" + "Microsoft Internet Explorer" + $LineBreak

Endif


If Instr( $App , "msimn.exe" )

$Programs = "$Programs" + "Microsoft Outlook Express" + $LineBreak

Endif

Loop

Endif

$Result = Close(1)

If $Programs <> ""

$Result = MessageBox("All programs must be Closed before Logging Off!" + $LineBreak + $LineBreak + "Close the following programs before Clicking on 'OK'" + $LineBreak + $LineBreak + "When you have finished, Click on OK and Select " + $LineBreak + "Logoff from the Start Menu" + $LineBreak + $LineBreak + "$Programs","System Information" , 4160)

Exit

Else

$Result = MessageBox("You will now be Logged Off the Network","System Information" , 4160 , 10)

Endif

_________________________
Kevin Cowans Senior ICT Technician The Armthorpe School