Dear sliver,

The problem with using counter as item is, that between a ReadProfileString and
WriteProfileString operation another user tries to run also that application. Impact
will be that your counter doesn't reflect the actual amount of users, who are running
your application.

Also we see that it has to deal with SMS software. In our situation not a problem to
use concept for software. Each user generates in this situation an unique record with
a size of 45 bytes. Another user doesn't have impact on yours. When the specific INI
file gets a size above 500*45 bytes 500 users are active at the same moment to run that
specific part/application.
To prevent possible situations of old entries we will try always to remove such
entries with latest WriteProfileString call.

Our solution is to use following code
code:
$sms_info_file="%logloc%\smseccm01\smsupgrade.ini"
$sms_key=SubStr(@userid+" ",1,3)+" sms"
IF ($GetFileSize($sms_info_file) < 500*45)
IF WriteProfileString($sms_info_file,"sms",$sms_key,"@date @time") ; - yyyy/mm/dd hh:mm:ss -
ENDIF
SHELL '%comspec% /c start /w run_sms.bat'
IF WriteProfileString($sms_info_file,"sms",$sms_key)
ENDIF
ELSE
? "Sorry, no upgrade this moment. Too many users already active."
ENDIF
IF WriteProfileString($sms_info_file,"sms",$sms_key)
ENDIF

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA