I am trying to shell a program as so
nResult = shell(" mcrypt.exe", 0)
This works fin but then I want to kill its temp file once it is finished. As
we all know Shell is asynchronous so I have this untill the user closes the
program.
while(tasks.exists(""mcrypt.tmp"))
' Delay
wend
Then the kill
Kill("mcrypt.tmp")
Single stepping through this it appears to work perfectly but in realtime
the kill gives me a 'Path/File access error' intermittently which means my
delay is not working properly. It appears to get to the kill after the
program has been removed from the task list but before it has actually
ended. Is there a better way around this?
And does anybody know what exactly is the task ID returned by the shell
command. It does not appear to have anything to do with the tasks.item
method
Many thanks
David I - 23 Dec 2006 23:06 GMT
Oops mucked up
Try
while(tasks.exists("mcrypt"))
' Delay
wend
That should make more sense
> I am trying to shell a program as so
>
[quoted text clipped - 23 lines]
>
> Many thanks
Jonathan West - 24 Dec 2006 01:48 GMT
>I am trying to shell a program as so
>
[quoted text clipped - 13 lines]
>
> Kill("mcrypt.tmp")
Use the ShellAndWait command from here
http://vb.mvps.org/samples/project.asp?id=Shell32

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup