objFSO.CreateFolder Run Once

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

mishcondereyaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
käµfm³d 👽Connect With a Mentor Commented:
If Not objFSO.FolderExists("C:\Temp") Then
    objFSO.CreateFolder "C:\Temp"
End If
0
 
usachrisk1983Commented:
Try:
if not objFSO.FileExists("c:\temp") then objFSO.CreateFolder "C:\Temp"

Open in new window

0
 
mishcondereyaAuthor Commented:
Quick!!!! Top man!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.