Computing.Net > Forums > Programming > self destruct batch file ?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

self destruct batch file ?

Reply to Message Icon

Name: raviepic3
Date: November 22, 2008 at 08:11:41 Pacific
OS: XP
CPU/Ram: enough
Comment:

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 :)



Sponsored Link
Ads by Google

Response Number 1
Name: pball
Date: November 22, 2008 at 09:07:01 Pacific
Reply:

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

other than that i have no clue what your saying


0

Response Number 2
Name: BatchFreak
Date: November 22, 2008 at 13:47:52 Pacific
Reply:

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.


0

Response Number 3
Name: Mechanix2Go
Date: November 22, 2008 at 21:03:52 Pacific
Reply:

Are you guys out of coffee?


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

M2


0

Response Number 4
Name: raviepic3
Date: November 22, 2008 at 22:07:54 Pacific
Reply:

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 :)


0

Response Number 5
Name: BatchFreak
Date: November 22, 2008 at 22:49:58 Pacific
Reply:

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.


0

Related Posts

See More



Response Number 6
Name: BatchFreak
Date: November 22, 2008 at 22:51:42 Pacific
Reply:

@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.


0

Response Number 7
Name: Mechanix2Go
Date: November 22, 2008 at 22:54:12 Pacific
Reply:

Because this thread makes less sense as it bumbles along.


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

M2


0

Response Number 8
Name: worldlibrary
Date: November 23, 2008 at 12:13:37 Pacific
Reply:

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.


0

Response Number 9
Name: raviepic3
Date: November 23, 2008 at 21:51:26 Pacific
Reply:

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 :)


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: self destruct batch file ?

self deleting batch file www.computing.net/answers/programming/self-deleting-batch-file/16219.html

Batch file waits for Notepad www.computing.net/answers/programming/batch-file-waits-for-notepad/13205.html

batch file programming www.computing.net/answers/programming/batch-file-programming/17121.html