如何在Windows 8.1中使用JavaScript创建文件夹 [英] How do I create a folder with JavaScript in Windows 8.1

查看:105
本文介绍了如何在Windows 8.1中使用JavaScript创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Windows 8.1中的Javascript创建一个包含文件的文件夹。我的脚本正在一个名为 Articulate Storyline ,不需要页眉或页脚。该脚本在Windows 7中运行良好,但不适用于Windows 8.1。 你能帮忙吗?我觉得某些安全设置会阻止脚本创建文件夹和文件。我已完全禁用所有病毒保护软件,并根据多个网站上的建议调整了我的浏览器设置。



目的

我正在使用它来在另一家公司托管的学习管理系统中查看电子学习课程。该课程只能在我们的内部系统中访问,因此我们不关心系统代表用户创建文件夹或文件。



用户将点击一个允许他们输入文字的按钮。文本保存在桌面上创建的文件夹中。用户可以在整个课程中单击按钮以添加更多信息,并更新文件以反映新信息。





脚本:

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:

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();





推荐答案

这篇关于如何在Windows 8.1中使用JavaScript创建文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆