xcall MIAMEX, MX_INSTNUM
(Windows) MX_INSTRUM returns your "instance number." This is the count of how many A-Shell/Windows sessions are running on your PC.
History
2006 January, A-Shell 4.9.948: Routine added to A-Shell