My issue is this:
I'm using a USB hard drive for replicating my backup data from a Win2003 SBS
machine. Whenever a plug the hard drive to the computer the replication
starts using robocopy.exe from Windows Resource Kit.
If I could manage to automatically unplug the USB hard drive when
replication is finished I got myself a fully automatic process. Equal
functionality to a tape solution but with so much more space capacity :D
--
Regards - Jonas Sackerud
dim bDone
bDone = false
set oQuerySink = wscript.createObject("wbemscripting.SWbemSink", "SINK_")
set NVS = createObject("WbemScripting.SWbemNamedValueSet")
set oContext = createObject("WbemScripting.SWbemNamedValueSet")
set svc = getObject("winmgmts:root\cimv2")
svc.Security_.AuthenticationLevel = 4
svc.ExecNotificationQueryAsync oQuerySink, "Select * From
win32_processStopTrace where processName = 'robocopy.exe'", "WQL", 0, NVS,
oContext
do while not bDone
wscript.sleep 1000
loop
set oContext = nothing
set NVS = nothing
set oQuerySink = nothing
sub SINK_OnObjectReady(obj, oContext)
wscript.echo obj.ProcessName
end sub
sub SINK_OnCompleted(hResult, oErr, oContext)
wscript.echo "OnCompleted for the query sink hr = 0x" & hex(hResult)
bDone = true
end sub
--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jonas Sackerud" <jonas.s...@seaflex.net> wrote in message
news:%23Kf2FC9...@TK2MSFTNGP12.phx.gbl...
Thanks for the sample code Scott. I've already written the functionality I
need for replication using robocopy.exe. All I need is the code to unplug
the USB device.
Thanks in advance - Jonas Sackerud
"[MS] Scott McNairy" <sco...@online.microsoft.com> skrev i meddelandet
news:4072e78d$1...@news.microsoft.com...
--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jonas Sackerud" <jonas.s...@seaflex.net> wrote in message
news:eqHFXRIH...@TK2MSFTNGP12.phx.gbl...
It would be so smooth to get this working, plug in the USB harddrive and
replication starts - when finished the USB drive is disabled and ready to be
moved offsite.
"[MS] Scott McNairy" <sco...@online.microsoft.com> skrev i meddelandet
news:4074...@news.microsoft.com...
--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jonas Sackerud" <jonas.s...@seaflex.net> wrote in message
news:uG0OaSTI...@tk2msftngp13.phx.gbl...
Thanks in advance
"Jonas Sackerud" <jonas.s...@seaflex.net> escribió en el mensaje
news:uG0OaSTI...@tk2msftngp13.phx.gbl...