I struggled and hacked at this for most the day trying to get it to work. Maybe someone with better knowledge could purify it a bit. You'll need to create this as an executble and put in an empty folder named C:\Test and when you run it it will vanish all traces of the EXE and the BAT that it created to remove the EXE:
Hi Kiffi... Thanks for reviewing my code. I like the way you cleaned up the bat file creation.
I thought variables inside a procedure were automatically protected so I never bother with it.
The MessageRequester was only there for demonstration purposes and should probably be removed in real practice to prevent the user from thwarting the cleanup.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Are you sure that your batch file is correct?
As far as I remember, a label must begin with a colon.
BTW: Batch files are executed line by line.
In the past, there could not be a CRLF after Del <mybatfile>.... (This may be different today.)
Just because it worked doesn't mean it works. PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Axolotl wrote: Mon Sep 01, 2025 4:59 pm
As far as I remember, a label must begin with a colon.
That is also how I recall it but grey matter is not what it used to be.
I've tested it several times and the executable worked flawlessly.
Create the executable and try it yourself.
Possible in my case it was fully successful on first pass and never hit the Goto command.
I checked with Meta AI and he confirmed the colon is required.
I will add to the OP -- THANKS!
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.