Articles

self destruct batch file ?

November 22, 2008 at 08:11:41
Specs: XP, enough

hi..

sorry if this sounds dumb...but i always wondered is there away to create a self destruct batch file ???

i mean if the file is executed it should but when opened for editing/viewing source the whole contents should get erased off (imagined abt self deleting but that would be impossible as it will be already loaded in memory to start opening the file so it will say file currently in use and cannot delete)when it is opened ....

is this possible plz do reply

programming newbie :)


See More: self destruct batch file ?

Report •


#1
November 22, 2008 at 09:07:01

um you can use del %0 to delete the batch script

other than that i have no clue what your saying


Report •

#2
November 22, 2008 at 13:47:52

I think he means it opens a file, type it to the screen... After a certain amout of time it deletes it ad the batch file.

SO would this work....

@echo off
Type "file"
PING 127.0.0.1 -n 1 -w "time" >NUL
DEL "file"
DEL %0
EXIT

I only Batch if possible, 2000 more lines of code, oh well.


Report •

#3
November 22, 2008 at 21:03:52

Are you guys out of coffee?


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions

#4
November 22, 2008 at 22:07:54

thank you all for replying...


what i meant will be more clear if i explain my scenario:

see let me assume that i have some important details written to a file using a batchfile.

now when some one execute it the write operation which i have coded in my batch should occur to the text file ...but when some one tries to open and view the source or edit it ...the whole content of the same batch file should self erase ....


i guess i explained clearly.....if have confused u poeple somewhere leme knw :)

programming newbie :)


Report •

#5
November 22, 2008 at 22:49:58

There is no way to do this, that i know off, you cannot make your batch just dissapear if someone tries to edit it.

One thing you could do is make it into an executable so the source file is hidden, this requires a compiler.

I only Batch if possible, 2000 more lines of code, oh well.


Report •

#6
November 22, 2008 at 22:51:42

@Mechanix2go coffee? Well it is 1 am out here, but why do you think I'm out of coffee?

I only Batch if possible, 2000 more lines of code, oh well.


Report •

#7
November 22, 2008 at 22:54:12

Because this thread makes less sense as it bumbles along.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#8
November 23, 2008 at 12:13:37

There is or was a program that will encrypt a batch file. Making it impossible to read.

Ohhhh, I think it was call "Dream" It was used to make books on floppy disk using pictures ,text and batch files......dos based but works on xp.

Years ago people wanted to know how to delete a batch file once run....to avoid detection. The bats contained puter killing code.

Funny part is...How does one test it out?

In your case I would get a program to convert the bat to a com file or Encrypt it.


Report •

#9
November 23, 2008 at 21:51:26

how does one test it out ??

ofcourse from the output they get i guess....


thanks for replying....


would be nice for me if u say how to encode batch files

programming newbie :)


Report •


Ask Question