Solved

Making a shadow copy of a mapped drive on vbscript

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

679 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