var folderForTempFiles = Folder.temp.fsName;
var text=activeDocument.name;
// create a new textfile and put the text into it
var clipTxtFile =new File(folderForTempFiles + "/ClipBoard.txt");
clipTxtFile.open('w');
clipTxtFile.write(text);
clipTxtFile.close();
// use the clip.exe to copy the contents of the textfile to the windows clipboard
var clipBatFile =new File(folderForTempFiles + "/ClipBoard.bat");
clipBatFile.open('w');
clipBatFile.writeln("type \"" + folderForTempFiles + "\\" + "ClipBoard.txt\" | clip");
clipBatFile.close();
clipBatFile.execute();