I need help troubleshooting this code. I created a temporary folder in the C drive, but for some reason the batch file isn't getting created. Can anyone provide some suggestions or insights?
var sText, s;
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (!fso.FileExists("C:\\temp\\COO_BTO_Test.bat")) {
s = fso.CreateTextFile("C:\\temp\\COO_BTO_Test.bat", true);
sText = "@echo off";
s.WriteLine(sText);
sText = ":Lbl";
s.WriteLine(sText);
sText = "ECHO \"^XA^MD0^PRB^JVY^LL1760^LH%XL%,%YL%^FS \">> COO.TXT";
s.WriteLine(sText);
sText = "ECHO \"^FO66,08^BY2,2.0,32^BCN,N,N,N^SN%Sno0%,1,Y^FS \">> COO.TXT";
s.WriteLine(sText);
sText = "ECHO \"^FO66,48^AF,8,8^SN%Sno0%,1,Y^FS \">> COO.TXT";
s.WriteLine(sText);
sText = ":END";
s.WriteLine(sText);
sText = "ECHO \"^PQ1 \">> COO.TXT";
s.WriteLine(sText);
sText = "ECHO \"^XZ \">> COO.TXT";
s.WriteLine(sText);
sText = "REM MODE COM1 9600"
s.WriteLine(sText);
sText = "REM TYPE COO.TXT > COM1"
s.WriteLine(sText);
sText = "TYPE COO.TXT > LPT1"
s.WriteLine(sText);
s.Close();
}