Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Making a shadow copy of a mapped drive on vbscript

Posted on 2004-08-25
5
Medium Priority
?
1,035 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 320 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
Suggested Courses

715 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