Questions tagged [fso]

Object Model component on Windows systems that represents the local file system.

The FileSystemObject (FSO) Object Model is used to access the local file system. Among other things, it provides methods for

  • reading file properties
  • creating and deleting files and folders
  • reading from files

For a complete list, visit the documentation link below.

Questions using the tag are expected to relate to programming

Links:

118 questions
0
votes
1 answer

How Can I Make Sure I Only Open Text Files When Working With FSO - VBA

Currently have a working script that uses FSO, but it also opens .xlsm files within my working directory. I would like to to only open .txt files. I found this code that should work, however I can't figure out how to apply it to my situation: Sub…
sikorloa
  • 101
  • 13
0
votes
1 answer

Distinguish between "file doesn't exist" and "access denied"

In a VBScript, I want to know if a file exists: Set fso = CreateObject("Scripting.FileSystemObject") If Not (fso.FileExists(file)) Then msg = " doesn't exist." End If My files are on internal network. Is there a way to distinguish: file…
0
votes
1 answer

Faster way to search pdf text string in a folder

I'm in desperate need of help, I'm trying to search a text string in a folder directory containing over 5000 pdf's, the code was tested and working with less than 100 pdfs and it works, but once it reaches the limit it takes over 5-10 minutes to…
0
votes
1 answer

WriteLine will not write lines with code

My method CreateScript will write all lines except for the three listed at the bottom. Sub CreateScript Dim objWMIService, arrIPAddress, colNetAdapters Dim objNetAdapter, arrSubnetMask, errEnableStatic Dim arrGateway, errGateways, fsow,…
jay bear
  • 37
  • 1
  • 1
  • 4
0
votes
1 answer

Small VBScript Does Not Work in HTA

I'm using the following VBSript and it works fine, however when I a attempt to add it to a .hta app I've created, it does not function correctly. Firstly, the 'strValue' does not show in the MsgBox and secondly script errors appear such as "Type…
jERCle
  • 111
  • 6
0
votes
1 answer

Create or delete a folder using FSO

Is there an FSO (file system object) method to create or delete a folder in JavaScript or VBScript? Any other JavaScript or VBScript method to create or delete a folder which works in HTA is also accepted.
Donald Duck
  • 8,409
  • 22
  • 75
  • 99
0
votes
0 answers

FSO (FileSystemObject) Move folder in itself

does anyone know how to recognize the error, when an Folder will be moved in itself? with the FSO.moveFolder no Problem to move them: fso.MoveFolder("C:\\Temp\\folder1", "C:\\Temp\\folder2\\"); but whats happen when i try to…
user3825577
  • 223
  • 1
  • 4
  • 11
0
votes
1 answer

Divide the files get from FSO

I've here an code which gives me the amount of the files, saved in an Folder: //get file amount in folder var fileAmount = new ActiveXObject("Scripting.FileSystemObject"); var folderObj = fileAmount.GetFolder("C:\\cnc\\USER"); //pfad, dann in…
user3825577
  • 223
  • 1
  • 4
  • 11
0
votes
1 answer

FileSystemObject FileExists works on one computer but not another

In Excel 2010 VBA, I'm using the FileExists property of the FileSystemObject to check whether a file exists. On my computer it works fine. But on another Excel 2010 computer, it reports that the file is not there when in fact we see in Windows…
Greg Lovern
  • 958
  • 4
  • 18
  • 36
0
votes
1 answer

FSO Writeblankline not working correctly

Does any one know why the .writeblanklines 3 does not work? I've tried plenty of different ways and it always seems to just overwrite the line in the textfile. Private Sub CommandButton3_Click() Dim fso As FileSystemObject Set fso =…
Lewis Morris
  • 1,916
  • 2
  • 28
  • 39
0
votes
2 answers

Classic ASP FSO Permission Denied

I trying to get list of file via Classic ASP FSO companent. But even I gave the root file permissions (IUSR_domain) from remote desktop, still I getting this error. Microsoft VBScript runtime error '800a0046' Permission denied /default2.asp, line…
0
votes
1 answer

Search in absolute file name web.config and not all files that start with web.configxxxx

I have a script that modifies the web.config customErrors Tags in a .net application and another script I run afterwards to check and ensure all tags have been changed. My issues is the fist script creates a copy of the web.config and names it…
tmac
  • 37
  • 7
0
votes
1 answer

FSO.CreateTextFile - Stops without action

I had reached some issues: