🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15131

Re: Spawning and Deleteing an exe file

#15131
From: Pete Fraser
Date: Wed, 16 Jul 2003 10:19
36 lines
2514 bytes
Look at MoveFileEx in WinAPI help.
This performs delayed deletes - when windows reboots.
HTH Pete

"Steve Craig" <stevecraig@ozemail.com.au> wrote in message
news:3f151e0f$1@newsgroups.borland.com...
Ed

Thanks for the response.  I tried your suggestion but it's still exhibiting
the same problem. It is very strange behavior, the file is not accessible, I
can't rename, copy or delete the file until I reboot. BTW I am using BCB 5.0
on windows 2000.
Anyway, I am going to try a different (although a little clumsy) alternative
using a bat file.  Thanks again...

Steve

"Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org> wrote in message
news:3f128e58@newsgroups.borland.com...
> You might try using CreateProcess and telling it to create a new process
> group.  Windows protects the exe files of executing programs.
>
> When using the spawn* family that program will default to being part of
the
> same process group as the program that spawned it.  The file may be
> protected until the calling process is ended.  With a new process group
you
> have a chance of being able to delete it after it finishes running.
>
> You will need to use some semaphore or mutex call such as
> WaitForSingleObject to detect when the program is no longer running.
>
> When asking something like this it would be useful if you mentioned what
> operating system and version and what compiler and version are being used.
>
> .  Ed
Technical Details
Message-ID: <3f1526b7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f127f9c@newsgroups.borland.com> <3f128e58@newsgroups.borland.com> <3f151e0f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,8871a81884d35a65
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-16 03:41:33 PST
From: "Pete Fraser" <pete.fraser@at.frasersoft.dot.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f127f9c@newsgroups.borland.com> <3f128e58@newsgroups.borland.com> <3f151e0f$1@newsgroups.borland.com>
Subject: Re: Spawning and Deleteing an exe file
Date: Wed, 16 Jul 2003 11:19:35 +0100
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 195.12.18.1
Message-ID: <3f1526b7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1058350775 195.12.18.1 (16 Jul 2003 03:19:35 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail