To delete batch file stored in %temp%

October 10, 2011 at 08:50:50
Specs: Windows 7
So i have finished coding my batch file but have a short problem. I do not want to share the source code but have had problems doing so. Using tools such as quick batch file compiler is no use at all since most of them are scams. This particular program called quick batch file compiler as i previously mentioned does nothing but encrypt the content of the batch file and store the original batch file in the %temp% folder as hidden resulting in having an easily way to view its source code just by simply enabling the option to view hidden files in explorer.exe and also i do not want to use such tools to convert it to an executable file since i want it to remain as a batch file. The only way i have found to protect the source code is to delete it as soon as possible after execution but have had problems finding where the batch file ends and creates the file containing the source code not encrypted and then after the part where the batch file finishes that part i can add the delete command without any real noticeable problems, interference or any slow down.

See More: To delete batch file stored in %temp%

Report •

#1
October 13, 2011 at 07:05:02
Thus are the limits of the medium you have chosen. Out of curiosity, what's so special about your batch files that you need to protect them so? Keep in mind you're asking on a site apparently known for giving away batch scripts.

How To Ask Questions The Smart Way


Report •

#2
October 14, 2011 at 07:03:05
No, no way am i going to store passwords its just something i have not fully coded to be functional/ up to date with the software it is going to be used for, so currently i want to keep the source code to myself. It also creates the file in the %temp% folder since it is binded with a .dll. I just need a suggestion on how to immediately delete the file with the visible source code as soon as possible after execution. The batch file also opens a selection window. In other words it has options you can chose from. Currently i do not have any other option than to fill the batch file with the delete command in parts where i guess it can be deleted with pause commands until i finally succeed. That though will take ages so i need a quicker solution. I have thought of a concept just now. I can create the batch file to do the delete command and run it after the main batch file has finished executing by setting a time and skipping lines. I need help with this since i am not that experienced.

Report •

#3
October 16, 2011 at 07:51:34
Nvm now ive figured it out. Pretty strange method i must say. :). It just needs a little tweaking and it will be perfect.

Report •

Related Solutions

#4
October 17, 2011 at 11:13:15
Pretty strange method i must say.
del "%~f0"
?

How To Ask Questions The Smart Way


Report •

#5
October 22, 2011 at 02:26:16
Sorry i haven't paid much attention to this question anymore but i am interested in what you have last posted. What does the following command do? del "%~f0"

Report •

#6
October 22, 2011 at 05:31:29
Makes a self-deleting batch file.

How To Ask Questions The Smart Way


Report •

#7
October 22, 2011 at 06:28:17
Or;

del 0%

Happy is ONE who says I am an OttoMAN.


Report •

#8
October 22, 2011 at 08:10:25
I don't normally do this anymore, but I'm out of coffee this morning.
Sat 2011.10.22 11.06.24
S:\>copy con a.cmd
del 0% ^Z
        1 file(s) copied.


Sat 2011.10.22 11.06.35
S:\>a


Sat 2011.10.22 11.06.36
S:\>del 0
Could Not Find S:\0


Sat 2011.10.22 11.06.36
S:\>dir /b a.*
a.cmd


Sat 2011.10.22 11.06.39
S:\>

I assume you meant %0, but that has its own, rarely encountered, problems

How To Ask Questions The Smart Way


Report •

Ask Question