Solved

Making a shadow copy of a mapped drive on vbscript

Posted on 2004-08-25
5
985 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
Comment Utility
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
Comment Utility
Recommend accepting BlueDevilFan http:#11911597
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now