Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Sebastian Schmidt on May 29, 2013, 12:09:32 am
-
Hi all,
i'd like to write some information to a simple text file using JScript, copied from the CSV example:
// fileName="C:\test.txt";
// fileName="C:\\test.txtl";
// fileName="C:/test.txt";
fileName="C://test.txt";
var fsObject = new ActiveXObject( "Scripting.FileSystemObject")
exportFile = fsObject.CreateTextFile( fileName, true );
exportFile.WriteLine( "--hello world --" );
I get either "Path not found" or "access denied" with these variants.
Hints on what I'm doing wrong? Exporting Artifacts to the file system from the EA GUI is not a problem.
Kind regards,
Sebastian
-
Did you check if you can create C:\test.txt manually?
-
Sebastian,
Since Windows 7 (or Vista maybe?) it is no longer allowed to create files on the C: root without elevated access.
You better create a directory to do your testing such as
C:\Test, so you can test the filename "C:\\Test\\test.txt" or variants thereof.
Geert
-
Thanks for your anwsers,
you were right, it was a rights management problem with the windows machine. I'm now able to write to the desktop, which is fine.
Kind regards,
Sebastian