I have moved my file server from Windows 2003 (32bit) to a new Windows 2012 R2 Server (x64).
I run a Shadow Copy once per hour on this server and have a script that manages the Shadow Copies quite well. However, when I moved the Script to the new server obviously I have some issues with it. here is the script as it was, as well as the error I get when I try to run it. Hoping someone could help with the changes needed to work on the new server.
Dim Time, AmPm, Hour
If Hour >= 18 Then
Msg = " This occurred after 6 PM"
'Msg = " This occurred before 6 PM"
Set dateTime = CreateObject("WbemScripting.SWbemDateTime")
Set nameSpace = GetObject("winmgmts://localhost/root/cimv2")
Set objSet = nameSpace.ExecQuery("select * from Win32_ShadowCopy")
If objSet.Count > 0 Then
For Each obj In objSet
dateTime.Value = obj.InstallDate
vDate = dateTime.GetVarDate(True)
aParts = Split(vDate, " ")
Time = aParts(1)
AmPm = aParts(2)
aParts = Split(Time, ":")
If AmPm = "PM" Then
Hour = aParts(0) + 12
Hour = aParts(0)
'WScript.Echo "- Snapshot on " & obj.VolumeName & " @ " & vDate
age = DateDiff("d", vDate, Date)
If age > 3 And Hour <> 18 Then
'WScript.Echo "[Deleting snapshot...] for " & obj.Caption & " created on " & vDate
End If[embed=file 690800]