if(fileextension(file_to_check) == "fsp") { lockfile = file_to_check+".lock"; if (!fileexists(lockfile)){ ?"==fsp== "+file_to_check; load(file_to_check); status = layoutmode; if (status == 1) { write(fname,"IF EXIST \""+lockfile+"\" exit /b 1"); write(fname,"copy /y NUL "+lockfile+" >NUL"); write(fname,"\"C:\Program Files\Lumerical\FDTD\bin\fdtd-engine\" -t 32 "+files{i}); write(fname,"echo del "+curdir+slash+lockfile); write(fname,"del "+curdir+slash+lockfile); write(fname,"exit /b 1"); break; } } }