Solved

vbs script to read file and check if folder is there

Posted on 2011-09-29
1
362 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now