Solved

objFSO.CreateFolder Run Once

Posted on 2009-05-08
3
362 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

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 During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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