Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to create a folder with a file using Javascript in Windows 8.1. My script is being used within a program called Articulate Storyline and does not require a header or footer. The script works fine in Windows 7, but not Windows 8.1. Can you help? I feel like some security setting is blocking the script from creating the folder and file. I have completely disabled all virus protector software and adjusted my browser settings as suggested on multiple websites.


Purpose
I'm using this for an e-Learning course to be viewed within a Learning Management System hosted by another company. The course can only be accessed within our internal system, so we are not concerned with the system creating a folder or file on behalf of the user.

The user will click a button that allows them to input text. The text is saved in a folder that is created on his desktop. The user can click the button throughout the course to add more information and the file is updated to reflect the new information.


Script:
C#
var fso = new ActiveXObject("Scripting.FileSystemObject");
var sFolderPath = "C:\\user\\Documents\\Test Folder\\";
if (!fso.FolderExists(sFolderPath)) {
    var newfolder = fso.CreateFolder("C:\\user\\Documents\\Test Folder\\"); 
}
var s = fso.OpenTextFile("C:\\user\\Documents\\Test Folder\\Test.txt", 8, true, 0); 
var player = GetPlayer();
var name = player.GetVar("TypeNotes");
var Date = player.GetVar("SystemDate");
var Time = player.GetVar("SystemTime");
s.WriteLine(Date + "       " + Time);
s.WriteLine("Notes: " + name);
s.WriteLine("==========");
s.Close();


Posted
Updated 19-May-14 6:34am
v6
Comments
Sergey Alexandrovich Kryukov 19-May-14 11:14am    
Where is Java?!!!
—SA
Member 10829080 19-May-14 11:18am    
The program I'm using does not require a header or footer to execute the script.
Sergey Alexandrovich Kryukov 19-May-14 11:23am    
Where is Java??? !!! !!!
—SA
Member 10829080 19-May-14 11:35am    
I don't believe I understand your question....are you referring to the script or the PC?
Sergey Alexandrovich Kryukov 19-May-14 11:41am    
I am just saying there is nothing related to Java in your question. Where? Any single line of Java code?
It does not matter. Java is no a scripting language. What makes you think that you are using Java at all?!
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900