undeletable batch file
Moderator: DosItHelp
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
undeletable batch file
I want to make a batch file that user can not delete that. is it possible?
Re: undeletable batch file
You need to be an administrator on the users computer ...
So, generally the answer is YES, but normally NO
Regards
aGerman
So, generally the answer is YES, but normally NO
Regards
aGerman
Re: undeletable batch file
Mohammad_Dos wrote:I want to make a batch file that user can not delete that. is it possible?
Um... I don't know. I think it may be possible, like making it a system file or something. But the closest solution I can think of is just hiding the file.
Code: Select all
@echo off
echo set fso = createobject("scripting.filesystemobject") : set file = fso.getfile("file.bat") : file.attributes = 2 > ~tmp.vbs
start ~tmp.vbs
ping 0 -n 1 > nul
del ~tmp.vbs
That will hide the file "file.bat".
Re: undeletable batch file
The batch command to do that is ATTRIB. But the user could configurate his explorer to show all files (incl. hidden & system files) and he could also clear these attributes.
Regards
aGerman
Regards
aGerman
Re: undeletable batch file
aGerman wrote:The batch command to do that is ATTRIB. But the user could configurate his explorer to show all files (incl. hidden & system files) and he could also clear these attributes.
Regards
aGerman
Oh, cool. I knew there was a command for it, I just couldn't remember what it was. But ya.
Code: Select all
@echo off
attrib +h file.bat
Okay, there. Fixed the code.
Re: undeletable batch file
'
Windows tracks open files.
If a program terminates in a way that leaves the file open, ( crashed while writing it )
It can't be deleted until reboot.
I've read somewhere it was possible to close such a file without rebooting,
simply by removing it from a list.
I never investigated this, I should implement this, Is it possible ?
I currently track all files a batch opens by registery keys, the above would make this obsolete.
Well it can be done, I'm just lazy ..
Windows tracks open files.
If a program terminates in a way that leaves the file open, ( crashed while writing it )
It can't be deleted until reboot.
I've read somewhere it was possible to close such a file without rebooting,
simply by removing it from a list.
I never investigated this, I should implement this, Is it possible ?
I currently track all files a batch opens by registery keys, the above would make this obsolete.
Well it can be done, I'm just lazy ..
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
Re: undeletable batch file
hiding the batch file is not a good idea. user may understand
but leave that file runing is a better...
can someone help me about it?
(sorry for my english)
but leave that file runing is a better...
can someone help me about it?
(sorry for my english)
Re: undeletable batch file
Batch files are not locked, even if they are running or opened by a text editor. So that doesn't work.
Regards
aGerman
Regards
aGerman
-
- Posts: 287
- Joined: 16 Mar 2011 19:17
- Location: scriptingpros.com
- Contact:
Re: undeletable batch file
Modify the file permissions as any other file. Maybe add some reg keys, but there is no permanent way as you call it, maybe to those not familiar with their OS but what is done can always be undone. You would be better off writing a 0 byte asm proggie.
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: undeletable batch file
I still don't trust this guy. His previous threads allude to him trying to build a type of virus, and now this.
viewtopic.php?f=3&t=1355
viewtopic.php?f=3&t=1557
dostips.com/forum/search.php?keywords=&terms=all&author=Mohammad_Dos&sc=1&sf=all&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search
Windows version / registry data / internet connectivity threads etc
I apologize if I'm wrong.
viewtopic.php?f=3&t=1355
viewtopic.php?f=3&t=1557
dostips.com/forum/search.php?keywords=&terms=all&author=Mohammad_Dos&sc=1&sf=all&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search
Windows version / registry data / internet connectivity threads etc
I apologize if I'm wrong.
-
- Posts: 287
- Joined: 16 Mar 2011 19:17
- Location: scriptingpros.com
- Contact:
Re: undeletable batch file
So what if he is trying to build a virus. Who cares it is in the destruction that builds a foundation. Without evil there can be no good, for it is all good.
Re: undeletable batch file
orange_batch wrote:I still don't trust this guy. His previous threads allude to him trying to build a type of virus, and now this.
viewtopic.php?f=3&t=1355
viewtopic.php?f=3&t=1557
dostips.com/forum/search.php?keywords=&terms=all&author=Mohammad_Dos&sc=1&sf=all&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search
Windows version / registry data / internet connectivity threads etc
I apologize if I'm wrong.
I'm with you Orange. I was suspicious just from his recent posts, but those old posts you dredged up are even more incriminating. I imagine there are much more effective techniques for building a virus than batch, but his posts make me uncomfortable.
Dave Benham
-
- Posts: 287
- Joined: 16 Mar 2011 19:17
- Location: scriptingpros.com
- Contact:
Re: undeletable batch file
There is no such thing as a batch virus, ridiculous is what that is. Who cares about viruses, who cares about any of it, just let it all die. I think just for kicks I'm going to pour gasoline all over my computer and set it ablaze, at least then I get to be the one that enjoys the carnage.
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: undeletable batch file
Pour the gas on yourself.
-
- Posts: 287
- Joined: 16 Mar 2011 19:17
- Location: scriptingpros.com
- Contact:
Re: undeletable batch file
orange_batch wrote:Pour the gas on yourself.
Oh orangutan my feelings have been bruised, though I do enjoy drinking gasoline.
Does your mother enjoy biocide?