filesystemobject

Use JavaScript/ActiveX to get list of files

心不动则不痛 提交于 2019-12-11 18:51:54
问题 I've been Googling for hours with no avail...! How do I use the Scripting.FileSystem object? In my current case, I want to fill a SELECT element with a list of folders from a particular location. Then, after selecting a folder, I want to display all images found within that folder. Thanks P.S. Security is not an issue. 回答1: You can not use Scripting.FileSystem in web pages because of security reasons. In case you have enough permissions to create such object (HTA or no IE security), it can be

Create Virtual Directory IIS7 to be use in GetFolder in Server.CreateObject(“Scripting.FileSystemObject”)

☆樱花仙子☆ 提交于 2019-12-11 14:23:23
问题 I am trying to create a virtual directory at my IIS7 and then use the virtual directory in the following code sPath = "\CMapped\database\attendanceData\" sDir = Server.MapPath(".") & sPath response.write sDir Set fso = Server.CreateObject("Scripting.FileSystemObject") Set obj_FolderBase = fso.GetFolder(sDir) response.end But I got the following error: What I have done is as follow: I created the virtual directory and set the path to C:\ Drive. My localhost is at D:\ drive. I have also set

Security Exception while use FileSystemObject in C#

拈花ヽ惹草 提交于 2019-12-11 13:39:17
问题 I want to write a fast disk usage detect program, and found that FileSystemObject is the fastest way to do this. And FileSystemObject is in COM -> Microsoft Scripting Runtime . All the code is simple, and I parsed here. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DiskUsage { class Program { const string FolderPath = @"C:\Windows\System32"; static void Main(string[] args) { var startTime = DateTime.Now; Scripting

Currupted file in non-english locale (encoding problem?)

扶醉桌前 提交于 2019-12-11 07:45:50
问题 In my MSI Windows Installer I have a custom VBScript action which extracts some files from the 'Binary' table to the filesystem. This is the code I'm using: Inspired by : https://www.itninja.com/question/how-to-call-an-exe-which-is-stored-in-a-binary-table-through-a-vbscript-custom-action-in-the-msi Function ExtractFromBinary(ByVal binaryName, ByVal binaryOutputFile) Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject") Const msiReadStreamInteger = 0 Const msiReadStreamBytes = 1

Enumerating Sub-Folder Properties with VBscript

烂漫一生 提交于 2019-12-11 06:48:32
问题 This is somewhat related to Microsoft System Center Configuration Manager 2007, but it's really about an issue with VBScript, the FileSystemObject API and reading sub-folder properties. I am trying to run a script to enumerate the folders and folder sizes on one of our Distribution Points (every folder beneath the Package Share). I'm using the FileSystemObject API, with VBscript, I can crawl about 60% of the sub-folders, and get their names and sizes, but then the rest return "error 70 /

File permissions with FileSystemObject - CScript.exe says one thing, Classic ASP says another

点点圈 提交于 2019-12-10 13:08:32
问题 I have a classic ASP page - written in JScript - that's using Scripting.FileSystemObject to save files to a network share - and it's not working. ("Permission denied") The ASP page is running under IIS using Windows authentication, with impersonation enabled. If I run the following block of code locally via CScript.exe: var objNet = new ActiveXObject("WScript.Network"); WScript.Echo(objNet.ComputerName); WScript.Echo(objNet.UserName); WScript.Echo(objNet.UserDomain); var fso = new

get document properties using VBS

守給你的承諾、 提交于 2019-12-08 07:39:16
问题 I have a folder containing few files. I would like to get, for each file, a list of all the properties assigned to this file and their values. I have written these few lines but I am not able to identify the right methods to use in the placeholders MethodIamLookingFor1 (to get list of properties assigned), MethodIamLookingFor2 (to get property name) and MethodIamLookingFor3 (to get property value): Dim sFolder sFolder = "C:\Batch_DEV\to" Dim objFSO, objDir, listObjFiles, objFile Set objFSO =

VBS: FileSystemObject use in Recursion

六月ゝ 毕业季﹏ 提交于 2019-12-08 07:03:03
问题 Currently I'm working on a script that will go through a given folder and search for all files with a specific extension. It will then print out the name and sum the file size. I believe i have most of the issues sorted out, so this question isn't about how to do this. Instead, I want to know what would be the best practice for using FileSystemObject streams in a recursive function. Should I be using a single stream for all calls (either global, or passed), or should I be creating a new

Why doesn't FileExists support wildcards?

▼魔方 西西 提交于 2019-12-08 02:45:25
问题 Consider this example VBScript fragment: Dim fs Set fs = CreateObject("Scripting.FileSystemObject") If fs.FileExists("D:\Folder\File*.ext") Then ' Finds nothing! fs.CopyFile "D:\Folder\File*.ext", "D:\OtherFolder\" fs.Deletefile "D:\Folder\File*.ext" End If The FileExists method turns out not to support wildcards ( * and ? ). Not does FolderExists. I expected wildards to just work because they work fine for all similar methods in the FileSystemObject: CopyFile, CopyFolder, MoveFile,

Why doesn't FileExists support wildcards?

南笙酒味 提交于 2019-12-06 13:47:55
Consider this example VBScript fragment: Dim fs Set fs = CreateObject("Scripting.FileSystemObject") If fs.FileExists("D:\Folder\File*.ext") Then ' Finds nothing! fs.CopyFile "D:\Folder\File*.ext", "D:\OtherFolder\" fs.Deletefile "D:\Folder\File*.ext" End If The FileExists method turns out not to support wildcards ( * and ? ). Not does FolderExists . I expected wildards to just work because they work fine for all similar methods in the FileSystemObject : CopyFile , CopyFolder , MoveFile , MoveFolder , DeleteFile , DeleteFolder and the Get* filename handling methods like GetAbsolutePathName . Of