Solved

Making a shadow copy of a mapped drive on vbscript

Posted on 2004-08-25
5
1,004 Views
Last Modified: 2010-05-18
I have a script that should do a copy of a directory of another computer of my network.
This script run at the server and the source directory (of the client machine )is mapped on server, "V:" for example..

How to do a shadow copy of the source directory (V:)?
Should I do a shadow copy? It is necessary, isn't it?
Is it possible?

Below, part of the script:

[...]
    Set objShadowStorage = objWMIService.Get("Win32_ShadowCopy")
    strVolume = "V:\"
   
    errResult = objShadowStorage.Create(strVolume, CONTEXT, strShadowID)

    if errResult <> 0 then
        WScript.Echo("ERROR:" & errResult)
        WScript.Quit(errResult)
    end if
[...]

When I execute the script it returns "ERROR: 13"

ps: Both computers, Server and Client, runs Windows 2003...

Thanks.
0
Comment
Question by:ricardosilveira
  • 2
5 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 80 total points
ID: 11911597
As I understand it a Shadow Copy is something that's set up once and then the system does the rest.  It's not like a normal copy operation that you run whenever you want.  Once established the operating system will automatically keep the copies in sync.  So you'd only need to run this once to set it up.  As for the Error 13, if you are using the litteral value CONTEXT, then I expect that's the problem.  Context is supposed to be filled in with the proper context enumeration from: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_shadowcontext.asp  Should you do a Shadow Copy, that's up to you.  It depends on your setting and there is no right answer.  Is it necessary?  No, it's an option.  Is it possible?  I certainly hope so!

Sorry, I don't have a 2003 server to test on or I'd be more specific.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12398538
Recommend accepting BlueDevilFan http:#11911597
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 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