问题标签 [filesystemobject]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1051 浏览

iis - Are there folder size limitations on virtual directory in IIS 7.5?

I have a couple virtual directories in IIS 7.5 that point to network resources. Specifically, these folders hold PDF files. I've granted a user permission to these folders, and their contents are accessible via web requests as I would expect. For example, http://mysite/dir1/test.pdf works perfectly for both virtual directories. However, when I try to expand one of the virtual directories (the other works fine) to see sub folders, IIS Manager becomes unresponsive almost immediately.

I'm attempting to list the file names of all PDFs in virtual directory on a classic ASP page.

On a separate page, I using identical code to list the contents of another virtual directory. However, this other directory (as with IIS Manager) causes problems by not responding. It causes the entire site to become unresponsive and I have to recycle to app pool to get it to come back.

The effective permissions for the user account used to access these resources are identical. All files are accessible, and I've confirmed they exist via hardcoding fso.FileExists(filepath & filename). I've also confirmed that the folder object exists and it's properties are being set. Even the folder.Files.Count is set properly in both cases. The issue is that the call to iterate through folder.Files causes the unresponsive behavior. Are there file size and/or folder size limitations? The only difference I see between the two directories is the number of files and consequently the size of the folder. The one that doesn't work is just over 1GB.

0 投票
2 回答
2338 浏览

scripting - 从VB脚本中的txt文件中读取多个变量

我希望能够一次将两个变量读入 VBScript。我正在做的是从一堆 HTML 文件中替换某些文本。我已经编写了一个脚本来执行此操作,但我一次只能输入一组文本。命令行示例:

C:> 替换.vbs (OldText) (NewText)

其中 (OldText) 和 (NewText) 都是参数。

有没有办法设置一个文本文件,如:

并让脚本一次读一个?

我的查找和替换代码完美运行。我只想自动化脚本以从文本文件中读取参数,而不是在命令提示符下一次输入一个参数。

任何帮助是极大的赞赏。如果需要更多信息,请告诉我。我希望这很清楚。谢谢

0 投票
1 回答
5048 浏览

excel - 带有汉字的Excel VBA TextStream.writeline

我对 VBA 相当陌生,并且对如何解决执行此代码时收到的“运行时错误'5':无效的过程调用或参数”错误感到困惑。有问题的单元格有中文字符,代码似乎在英文字母上运行良好。流正在输出到文本文件。(将来应该是一个xml文件,但我仍然没有实现所有正确的格式)

...

谢谢!克里斯

0 投票
1 回答
889 浏览

vbscript - 检查旧文件和新文件,如果不存在任何内容,则使用 vbscript 创建一个

所以我正在尝试为 Windows 编写一个脚本来检查用户是否同时存在旧的和新的 Outlook 配置文件。如果旧文件存在而新文件不存在,则会复制旧文件并为其指定新文件名。

我对语法有一个大致的了解,看起来像这样。

更新!
这是我到目前为止所能想到的。

我不是要求任何人为我写这篇文章,但如果有人能指出我正确的方向,那就太好了。

0 投票
1 回答
6503 浏览

iis-7 - 带有经典 ASP 的 FileSystemObject 在 IIS7+ Win server 2008 上无法正常工作

最近我将我的经典 asp 应用程序从 Windows XP + IIS5 移动到 Windows Server 2008 + IIS7。除了一件事之外,几乎一切工作正常...... FileSystemObject 无法访问远程 PC 中共享文件夹上的文件或文件夹。以下代码总是导致“文件不存在”,相信我文件存在!

在本地文件夹上尝试 FileExists 时,它可以正常工作。这工作正常:

有谁知道如何解决这个问题?

0 投票
3 回答
27291 浏览

vbscript - 如何确定文件是否使用 VBS 锁定?

我正在编写一个 VB 脚本来更新网络上的一些文件。在开始之前,我想知道是否有任何文件被锁定。我想在实际进行任何更新之前执行此操作。

我知道如果在尝试替换文件时文件被锁定,我可以处理该错误,但我真的想知道在开始更新任何文件之前是否有任何文件被锁定。

有什么方法可以查看使用 VBS 锁定文件(除了尝试替换它)?

0 投票
2 回答
3687 浏览

vbscript - Get full server path of running VBScript file

is it possible to get the full server path of a VBScript file while it is running, but instead of showing the drive letter, it shows the server name?

I know I can use FileSystemObject's GetAbsolutePath, but instead of it showing S:\Some Folder\FileName.vbs, it shows \\servername\Some Folder\FileName.vbs?

0 投票
1 回答
54510 浏览

javascript - 如何使用 FileSystemObject 在 JavaScript 中读取文件

我想用 FileSystemObject 读取文件。我的代码如下:

0 投票
2 回答
770 浏览

asp-classic - ASP Classic - 使用 FileSystemObject 确定文件是二进制文件还是文本 (ascii)

如果我将文件分类为二进制(例如:.exe、.mp3、.docx、.pdf)和文本(例如:rtf、txt、html、xml),那么我们如何使用经典的 ASP 的 FSO 来确定什么样的文件一个特定的文件是?

0 投票
1 回答
333 浏览

c++ - 在 C++ 中使用 Scripting.FileSystemObject 时,#import 之后的下一步是什么?

上下文:Windows 7、XLW 5.x、Microsoft Excel 2007、Visual Studio 2010、C++

鉴于以下代码...

我现在如何实例化 FileSystemObject 并调用它的方法?