Solved

vbs script to read file and check if folder is there

Posted on 2011-09-29
1
365 Views
Last Modified: 2012-05-12
hello hope you can help me, I need vbs script to read file TXT or XLS and check if folder is there

if not it writes to a file...
0
Comment
Question by:James Murrell
1 Comment
 
LVL 7

Accepted Solution

by:
OklahomaDave earned 500 total points
ID: 36902734
You should take a look at instantiating a Scripting.FileSystemObject. It has built-in methods to check for folder and file existence, and to open text files. Here's a sample of how to check for the presence of a folder:

function doesFolderExist(folderName)

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
doesFolderExist = fso.FolderExists(folderName)

end function

You can also leverage the OpenTextFile method to read the TXT file. Reading .XLS files is a much more difficult task I'm not sure you really want to undertake in a VBScript file.

That should be enough to give you a push in the right direction. If you need further help, just post again and we'll go from there!

Good luck!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question