darkmastergyz
Registered User.
- Local time
- Today, 05:08
- Joined
- May 7, 2006
- Messages
- 85
Hi! So this is the code I'm using to copy a file:
Dim fs As Object
Dim oldPath As String, newPath As String
oldPath = "C:\" 'Folder file is located in
newPath = "C:\test" 'Folder to copy file to
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile oldPath & "\" & "test.mp3", newPath & "\" & "test3.mp3"
Set fs = Nothing
How can I make it create "c:\test" if it doesn't exist. Right now, it's giving me an error when I try to do that.
Thanks
Dim fs As Object
Dim oldPath As String, newPath As String
oldPath = "C:\" 'Folder file is located in
newPath = "C:\test" 'Folder to copy file to
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile oldPath & "\" & "test.mp3", newPath & "\" & "test3.mp3"
Set fs = Nothing
How can I make it create "c:\test" if it doesn't exist. Right now, it's giving me an error when I try to do that.
Thanks