Thanks for the feedback Glenn.

The brief background on what I'm trying to accomplish:

We launch an application for end users via a Kix script which makes environment (prod / qa / dev) type modifications to an INI file before running the app EXE.

We've found out that several staff are running up to 4 copies of the application EXE, and I've gotten authorization to limit them to only 2 copies of the EXE.

So what I'm looking to do with the Kix script mods is essentially EXE count tracking. By creating a txt file each time a user launches the application EXE, and deleting the created txt file each time a user closes the EXE.

The script logic for creation of the txt files and checking for existing txt files prior to launching the application EXE was what I was looking to get sorted out with the 'EXIST / AND' statements. I'm actually going to redo that section in 'select - case' format as it seems a better fit than 'IF'.

With regards to the RUN issue, my problem is this logic:

 Code:
If $File1 = 1 AND $File2 = 0
copy "c:\scripts\session.txt" "$variable2"
RUN "c:\scripts\session2.cmd" EXIT
ENDIF


The CMD file being referenced has the following in it:

 Code:
Start "Application" /wait C:\application\app.exe \\servername\share\app.ini
del \\servernameb\share\session2.txt /q
exit


I'm using the '/wait' in order to keep the CMD file running so that once the EXE is closed the DEL will trigger and clear the session tracker txt.

I know a CMD will be open under the user session because of this, what I've found in /debug however is that using RUN to call the CMD file doesn't exit out the kix script as I would have expected. The kix script is instead waiting for the CMD file that's been called complete before it exits.

This is not a huge problem, however I would prefer that the kix script call the CMD file used the run the app, and then close out without waiting for it to end.

Thanks,

TS