Solved

objFSO.CreateFolder Run Once

Posted on 2009-05-08
3
375 Views
Last Modified: 2012-05-06
Hello

I have a command in my logon script to do the necessary, but of course, when you next log on you get a lovely error message saying the folder already exists.

What other code do I have to include so I this line will only run when C:\Temp doesn't exist?

Thanks.
objFSO.CreateFolder "C:\Temp"

Open in new window

0
Comment
Question by:mishcondereya
3 Comments
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 24334982
Try:
if not objFSO.FileExists("c:\temp") then objFSO.CreateFolder "C:\Temp"

Open in new window

0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 24334998
If Not objFSO.FolderExists("C:\Temp") Then
    objFSO.CreateFolder "C:\Temp"
End If
0
 

Author Closing Comment

by:mishcondereya
ID: 31579383
Quick!!!! Top man!!!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

789 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