All,

I have a VB program that executes several scripts in sequence... so it
has to wait for each script to finish before the next one runs. The
scripts themselve take only a few seconds to run, however it takes
several seconds before the command prompt is returned and the window
is closed (and the vb program can continue).

Why is it that when a script finished, it still takes several seconds
before the command prompt is returned?
Is there a way to solve this.

Running my vb program takes a lot of time now... mostly waiting for
scripts to close.

Any help would be appriciated.

Regards,
Jan-Willem

Re: When vb script finishes, still have to wait several seconds before by mr_unreliable

mr_unreliable
Tue Nov 27 09:13:48 PST 2007

hi Jawiko,

It would help if you explained the mechanism you use in vb
to START the script, and what you are doing to WAIT FOR
the script to close.

It might also help if you could characterize your scripts.
For example, when run as stand-alone, your "window" (cscript?)
might close, but the script may still be busy "cleaning-up",
i.e., releasing resources -- until the process terminates
completely.

cheers, jw

Jawiko wrote:
> All,
>
> I have a VB program that executes several scripts in sequence... so it
> has to wait for each script to finish before the next one runs. The
> scripts themselve take only a few seconds to run, however it takes
> several seconds before the command prompt is returned and the window
> is closed (and the vb program can continue).
>
> Why is it that when a script finished, it still takes several seconds
> before the command prompt is returned?
> Is there a way to solve this.
>
> Running my vb program takes a lot of time now... mostly waiting for
> scripts to close.
>
> Any help would be appriciated.
>
> Regards,
> Jan-Willem

Re: When vb script finishes, still have to wait several seconds by Jawiko

Jawiko
Tue Nov 27 09:22:05 PST 2007

Hey thanks for your answer...
Basically it comes down to this:

My VB program creates a folder with several subfolders in it.
Each subfolder must have its own set of permissions. I am using XCACLS
to set these permissions.
So, my VB program writes a batch files that runs the XCACLS script
(with parameters) for each folder.
An example of a batch file looks like this (please do not be bothered
about the paramaters they have nothing to do with it):

cscript XCACLS.VBS "j:\client data\02 Customers\Foldername1" /G
"inl.local\domain users":L "INL.local\CDM_Admins":F >181731-5334.0

cscript XCACLS.VBS "j:\client data\02 Customers\Foldername1\Finance" /
G "INL.local\CDM_Admins":F "INL.LOCAL\CDM_Finance_R":L "INL.LOCAL
\CDM_Finance_C":M >181731-5334.1

cscript XCACLS.VBS "j:\client data\02 Customers\Foldername1\Enhanced
Services" /G "INL.local\CDM_Admins":F "INL.local\CDM_Enhanced
Services_R":L "INL.local\CDM_Enhanced Services_C":M >181731-5334.2

cscript XCACLS.VBS "j:\client data\02 Customers\Foldername1\Service
Delivery" /G "INL.local\CDM_Admins":F "inl.local\CDM_Service
Delivery_R":L "inl.local\CDM_Service Delivery_C":M >181731-5334.3


It just takes each line like 10 seconds to return the command prompt
(and the script is finished in a few secs)