School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,212 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,581 people online right now. Registration is fast and FREE... Join Now!




Microsoft Vbscript runtime error (58, 2)

 

Microsoft Vbscript runtime error (58, 2), I receive this error while running my script. How to overcome this?

dunk_6

8 Oct, 2009 - 01:21 AM
Post #1

New D.I.C Head
*

Joined: 3 Aug, 2009
Posts: 43



Thanked: 1 times
My Contributions
Hi,


I get this runtime error (58, 2) : File already exists for my program.
What can i do to capture this error and do overwrite the files if still exist.?

It seems this cause it to happened:

CODE
Sub moveToDest()
    dim newfolder
    Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
    If  Not objFSO.FolderExists(dest) Then
       newfolder = objFSO.CreateFolder (dest)
       WScript.Echo "A new folder '" & newfolder & "' has been created"
    End If
    objFSO.MoveFile source & "*.pac" , dest

End Sub


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 09:48PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month