filesystemobject

Unicode named Folder shows ? in wscript prompt

喜你入骨 提交于 2021-02-07 19:25:23
问题 I am facing problems with Unicode named folders. When I drag the folder to the script, it doesn't show the path of the folder properly. Simple VBScript (this is just a portion of it): Dim Wshso : Set Wshso = WScript.CreateObject("WScript.Shell") Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject") If WScript.Arguments.Count = 1 Then If FSO.FileExists(Wscript.Arguments.Item(0)) = true and FSO.FolderExists(Wscript.Arguments.Item(0)) = false Then Alert "You dragged a file, not a folder

Trying to use Shell object and FileSystemObject in VBScript for file manipulation

一个人想着一个人 提交于 2021-01-28 19:51:36
问题 I am trying to recursively loop through hundreds of directories, and thousands of JPG files to gather sort the files in new folders by date. So far, I am able to individually GetDetailsOf the files using the Shell NameSpace object, and I am also able to recursively loop through directories using the FileSystemObject. However, when I try to put them together in functions, etc, I am getting nothing back when I try to get the DateTaken attribute from the photo. Here is my code so far:

How to remove NUL strings at begining of CSV; VBA

我是研究僧i 提交于 2021-01-28 18:53:42
问题 I have a program that exports a bill of material (see CSV example data lower in post). I wrote a VBA macro that uses FileSystemObject to loop through a user-selected folder, open the CSV files for reading and read the data into memory using ReadAll, then store and sort the data in excel. The problem I have is after exporting the CSV files, I run the macro and the text in the CSV file is stored in my string variable (sTemp in the code below) as several square braces. I copied the value of the

How mark Scripting.FileSystemObject as safe for scripting?

故事扮演 提交于 2021-01-27 20:32:16
问题 Introduction: I'm programing a CNC machine. To be exact a Rover from Biesse. The editor from the software that is used to programing support VBScript. VBScript is used for implementing conditional statments and loops etc. In instruction to the software i have listed all syntax from VBScript marked as not to be used to avoid complication :) Of course I would like to use VBScript :) To be exact - to open txt file and set up program base on the content. The main problem: All the syntax of the

Access VBA to delete a file to the recycle bin?

廉价感情. 提交于 2020-01-14 02:59:10
问题 Using the following code delete's my file, but it doesn't go to the recycle bin - does code exist that will send it to the recycle bin? Should I use ".Move" ? If MsgBox("DELETE:" & Chr(10) & Forms("frmtbl").f_FullPath & Me.f_FileName & " ?", vbYesNo) = vbYes Then 'Kill Forms("frmtbl").f_FullPath & Me.f_FileName Dim objFSO As Object Set objFSO = CreateObject("Scripting.FileSystemObject") objFSO.DeleteFile (Forms("frmtbl").f_FullPath & Me.f_FileName) DoCmd.Close acForm, Me.Name Else MsgBox

What is the correct way to declare and define a FileSystemObject object on VBA?

微笑、不失礼 提交于 2020-01-12 11:03:11
问题 I was reading about how to declare FileSystemObjects objects and I found confusing information. Is it because there are different ways to declare it? I let you some of the ways I found to declare and define FileSystemOjbect objects: Dim FSO As FileSystemObject Set FSO = New FileSystemObject Dim FSO As New FileSystemObject Dim FSO As Object Set FSO = CreateObject("scripting.filesystemobject") Which is the right way to declare FileSystemObject objects? 回答1: All 3 ways are correct. You have hit

Excel VBA efficient get file names function

荒凉一梦 提交于 2020-01-11 04:55:08
问题 I need to get a collection of file names from a folder on a remote server using VBA in excel 2010. I have a function that works and in the majority of cases it would do the job, however the remote server frequently has terrible, terrible network performance issues. This means that looping through say 300 files to put their names into a collection can take 10 minutes, the number of files in the folder is likely to grow to thousands so this is not workable, I need a way to get all of the file

ActiveX Control always working on my machine - unpredictable behavior on others?

随声附和 提交于 2020-01-06 12:45:54
问题 I have a question about my ActiveX control not always working in IE on other machines. Context: I'm working on an internal app for my company. It is designed to be a standalone web-page config tool for viewing a static customized version of our web app. The user may select the colors, images, and other settings they would like to see, and these will be present in the static mockup/preview version on their machine when they click a button. Implementation: my javascript file creates a

Use Scripting.FileSystemObject to create file in path that doesn't already exist

此生再无相见时 提交于 2020-01-05 09:03:13
问题 I'm trying to create a text file using the Scripting.FileSystemObject in JScript. I can't seem to figure out how to create the file if a directory in the file doesn't already exist. For example: var fso = new ActiveXObject("Scripting.FileSystemObject"); // Getting a JScript runtime error of "Path not found" fso.CreateTextFile("\\\\pathA\\pathB\\DirectoryDoesntExistButIWantItTo\\newfile.txt", true); I've been looking all over but it seems like the documentation on this isn't neatly put in one

Text is being over written when it's supposed to be appended

巧了我就是萌 提交于 2020-01-04 09:55:04
问题 This seems really easy (I've done it a million times and never had a problem), but it's killing me. I want to create some SQL scripts based on content in an Excel spreadsheet. To do this I've created a macro that reads a text file using the code below Dim fso As FileSystemObject Set fso = New FileSystemObject Dim stream As TextStream Set stream = fso.OpenTextFile(filepath, 8, False) This is supposed to open the text file for appending and plug in my new values. Unfortunately, it's always