Shoutbox

Creating a text file - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Creating a text file (/showthread.php?tid=87603)

Creating a text file by hunter1577 on 12-04-2008 at 09:01 PM

Er.. hi everybody
I just wanna know how i can create a text file anywherer in the pc with the Plus script and write something in it =]

Thanks
Hunter ~


RE: Creating a text file by roflmao456 on 12-04-2008 at 09:11 PM

You can try using the FileSystem Object (function OpenTextFile or CreateTextFile).

example:

JScript code:
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.OpenTextFile("c:\test.txt" /*filename*/,2 /*mode;1=reading;2=writing;8=append*/, true /*create if non-existant*/);


To write something in it, use the Write or WriteLine function
RE: Creating a text file by matty on 12-04-2008 at 09:16 PM

For a beginner take a look at FileSystemObject and the function CreateTextFile.

quote:
Originally posted by roflmao456
example:
JScript code:
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.OpenTextFile("c:\test.txt" /*filename*/,2 /*mode;1=reading;2=writing;8=append*/, true /*create if non-existant*/);


It should be:
code:
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.OpenTextFile("c:\\test.txt" /*filename*/,2 /*mode;1=reading;2=writing;8=append*/, true /*create if non-existant*/);