Solved

Making a shadow copy of a mapped drive on vbscript

Posted on 2004-08-25
5
1,009 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

861 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