看看下面的例子吧:
[JScript]
var fso, f;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.CreateTextFile("c://testfile.txt", true);
f.WriteLine("This is a test.");
f.Close();
f = fso.GetFile("c://testfile.txt");
f.Copy("c://windows//desktop//test2.txt");
[VBScript]
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c:/testfile.txt", True)
MyFile.WriteLine("This is a test.")
MyFile.Close
Set MyFile = fso.GetFile("c:/testfile.txt")
MyFile.Copy ("c:/windows/desktop/test2.txt")