clear; redrawoff; status = layoutmode; slash = "/"; if (operatingsystem == "windows") {slash = "\\";} curdir = pwd; files = splitstring(dir,endl); isCreated = false; fname = curdir+slash+"exec.bat"; if (fileexists(fname)){rm(fname);} for(i=1:length(files)) { if(fileextension(files{i}) == "fsp") { load(files{i}); status = layoutmode; if (status == 1) { write(fname,"\"C:\Program Files\Lumerical\FDTD\bin\fdtd-engine\" -t 32 "+files{i}); write(fname,"exit /b 1"); break; } } } write(fname,"exit /b 0"); redrawon;