10-12-2009, 10:58 PM
There might be a few ways to handle this one.
My first thought would be to create a file test or something using FSO..
Something like.....Script 1
'start by deleting the file
fso = CreateObject("file.scripting")
fso.Delete("path\name")
'the rest of script 1
here......
'When complete write a file someplace
fso.open("path\name", ForAppend, True) 'True to create if missing
fso.writeline "Completed" 'doesn't really matter unless you want to poll for results
fso.close
Script 2
'Start by checking if script 1 is complete.
fso = CreateObject("file.scripting")
while found = false
on error resume next 'just incase FSO throws an error for doesn't exist
found = fso.Exist("path\name") 'same path\file as script 1
wait(60) 'Sleep for 1 min
loop
on error goto 0 'Reset error trapping
'continue with the rest of the script
This is not the exact code. I'm a little rusty on the FSO (File Scripting Object) capabilities, but I know it can check if a file exists. The loop in the second script will wait and continue to test for the file existence before continuing with the script. You could also use a database or even a registry key and poll the value before continuing, but I think the FSO will be easier especially with a non-monitored system script.
Hope this helps.
My first thought would be to create a file test or something using FSO..
Something like.....Script 1
'start by deleting the file
fso = CreateObject("file.scripting")
fso.Delete("path\name")
'the rest of script 1
here......
'When complete write a file someplace
fso.open("path\name", ForAppend, True) 'True to create if missing
fso.writeline "Completed" 'doesn't really matter unless you want to poll for results
fso.close
Script 2
'Start by checking if script 1 is complete.
fso = CreateObject("file.scripting")
while found = false
on error resume next 'just incase FSO throws an error for doesn't exist
found = fso.Exist("path\name") 'same path\file as script 1
wait(60) 'Sleep for 1 min
loop
on error goto 0 'Reset error trapping
'continue with the rest of the script
This is not the exact code. I'm a little rusty on the FSO (File Scripting Object) capabilities, but I know it can check if a file exists. The loop in the second script will wait and continue to test for the file existence before continuing with the script. You could also use a database or even a registry key and poll the value before continuing, but I think the FSO will be easier especially with a non-monitored system script.
Hope this helps.