Creating Directories

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

I am looking for a way to check if a directory exists on a
machine. If it dosn't I want to create it.

Can anybody help?
 
Hi Keith,

On Error Resume Next
MkDir "C:\YourNewFolderName"
On Error GoTo 0
 
Hi Keith
On Error Resume Next
ChDir "C:\Papou"
If Err <> 0 Then MkDir "C:\Papou"

HTH
Cordially
Pascal
 
Well, I've coded that way :

Set a = CreateObject("Scripting.FileSystemObject")

If a.folderexists("c:\temp") Then

Else
a.createfolder ("c:\temp")
End I
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top