Commit 8ff7f638 by U-GSELLC\jrdalrymple

Initial commit - this does work

parents
Set objFSO=CreateObject("Scripting.FileSystemObject")
Const VOLUME = "C:\"
Const CONTEXT = "ClientAccessible"
outFile="C:\vscbackup\vsc.id"
Set objFile = objFSO.CreateTextFile(outFile, True)
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objShadowStorage = objWMIService.Get("Win32_ShadowCopy")
errResult = objShadowStorage.Create(VOLUME, CONTEXT, strShadowID)
objFile.Write strShadowID
objFile.Close
Set colItems = objWMIService.ExecQuery("Select * from Win32_ShadowCopy")
For Each objItem in colItems
If objItem.ID = strShadowID Then
strDeviceObject = objItem.DeviceObject
arrDeviceObject = split(strDeviceObject, "\")
strVSCOut = arrDeviceObject(UBound(arrDeviceObject))
End If
Next
Wscript.Echo strVSCOut
Wscript.Quit 0
{70E020EF-152C-4449-834E-0742AB7011C5}
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp. Error: Invalid option. Delete Shadows /For=ForVolumeSpec [/Oldest] [/Quiet] Delete Shadows /Shadow=ShadowId [/Quiet] Delete Shadows /All - For the given ForVolumeSpec deletes all matching shadow copies. If /Oldest is given, the oldest shadow copy on the volume is deleted If /All is given, then all shadow copies on all volumes that can be deleted will be deleted. If /Shadow=ShadowId is given, the shadow copy with that Shadow Copy ID will be deleted. Only shadow copies that have the ClientAccessible type can be deleted. - The Shadow Copy ID can be obtained by using the List Shadows command. When entering a Shadow Copy ID, it must be in the following format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} where the X's are hexadecimal characters. This ID can be obtained through the List Shadows command. Example Usage: vssadmin Delete Shadows /For=C: /Oldest
{70E020EF-152C-4449-834E-0742AB7011C5}
/cygdrive/c/Windows/system32/vssadmin delete shadows /ShadowID\={70E020EF-152C-4449-834E-0742AB7011C5} /Quiet
{70E020EF-152C-4449-834E-0742AB7011C5}
/cygdrive/c/Windows/system32/vssadmin delete shadows /ShadowID={70E020EF-152C-4449-834E-0742AB7011C5} /Quiet
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp. Error: Invalid option. Delete Shadows /For=ForVolumeSpec [/Oldest] [/Quiet] Delete Shadows /Shadow=ShadowId [/Quiet] Delete Shadows /All - For the given ForVolumeSpec deletes all matching shadow copies. If /Oldest is given, the oldest shadow copy on the volume is deleted If /All is given, then all shadow copies on all volumes that can be deleted will be deleted. If /Shadow=ShadowId is given, the shadow copy with that Shadow Copy ID will be deleted. Only shadow copies that have the ClientAccessible type can be deleted. - The Shadow Copy ID can be obtained by using the List Shadows command. When entering a Shadow Copy ID, it must be in the following format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} where the X's are hexadecimal characters. This ID can be obtained through the List Shadows command. Example Usage: vssadmin Delete Shadows /For=C: /Oldest
{70E020EF-152C-4449-834E-0742AB7011C5}
/cygdrive/c/Windows/system32/vssadmin delete shadows /Shadow={70E020EF-152C-4449-834E-0742AB7011C5} /Quiet
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp.
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp. No items found that satisfy the query.
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp.
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp.
#!/bin/bash.exe
shadowid=$(< /cygdrive/c/vscbackup/vsc.id)
cmd="/cygdrive/c/Windows/system32/vssadmin delete shadows /Shadow=$shadowid /Quiet"
echo $($cmd) >> /cygdrive/c/vscbackup/log
rm /cygdrive/c/vscbackup/vsc.id
rm /cygdrive/c/vscbackup/vsc
#!/bin/bash.exe
winpath="C:\vscbackup\createvsc.vbs"
vsc=`cscript.exe //nologo $winpath`
echo $vsc
vsc=`echo $vsc | tr -d '\r'`
ln -s /proc/sys/Device/$vsc/ /cygdrive/c/vscbackup/vsc
#!/bin/bash.exe
/cygdrive/c/Windows/system32/schtasks /run /tn BackupPC-VSC-Cleaner
#!/bin/bash.exe
/cygdrive/c/Windows/system32/schtasks /run /tn BackupPC-VSC
while [ ! -h /cygdrive/c/vscbackup/vsc ]
do
sleep 2
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment