Solved how can i create a batch to delete all picture files in a pc

October 25, 2016 at 19:15:22
Specs: Windows
I need a batch file that will search all drives in a PC and delete picture files, that is, .jpeg, PNG,gif.
The batch should run automatic and in the background
I also want that if the batch is in a USB drive or memory card or even the phone memory , as soon as it connects to a PC, the batch executes and deletes all pics from the PC and the drive
Please I need your suggestions and this will help me greatly.

See More: how can i create a batch to delete all picture files in a pc

Reply ↓  Report •


✔ Best Answer
November 2, 2016 at 22:17:54
I haven't tried to use this, so I'm not familiar with all the prerequisites permissions etc. you might try putting a file: autorun.inf in root of the flashdrive. content:
[autorun]
c:\windows\system32\cmd.exe /c .\delpics.bat

(whatever name you have for the script, I used delpics.bat)
Most OS will reject outright or present dialogue walls before executing "autorun" from flash drives, for obvious reasons.



#1
October 25, 2016 at 23:42:56
Why would you have a silent background program to automatically delete all picture files on any computer it connects to?

Sorry but this sounds rather malicious...

Don't worry if plan A fails, there are 25 more letters in the alphabet ;)


Reply ↓  Report •

#2
October 26, 2016 at 09:18:45
Highly malicious and suspicious I would say.

Always pop back and let us know the outcome - thanks


Reply ↓  Report •

#3
October 26, 2016 at 09:48:29
Hi Derek,

LOL I'd be hard to convince this is on the up and up.

=====================

M2 Get custom script or take private lessons


Reply ↓  Report •

Related Solutions

#4
October 26, 2016 at 13:26:27
Hi Mechanix2Go

Yeah, too right.

Good to see you still buzzing away on these boards. I guess you must be our most senior member now.

Always pop back and let us know the outcome - thanks


Reply ↓  Report •

#5
October 27, 2016 at 11:11:13
We run a training school for teenagers on computer studies, its part of our campaign to keep children off the streets. Some of this children have been into scamming and others often share nude pics when they are not monitored, we gave discovered pics in hidden folders that they share across the net. So the batch file will be run from a flash drive inserted to all the PC two times a day
This way all picture files will be deleted

Reply ↓  Report •

#6
October 27, 2016 at 11:12:16
Its not for any malicious act please

Reply ↓  Report •

#7
October 27, 2016 at 16:23:04
Well, considering you're dealing with a) teenagers and b) ones learning computer skills, you will probably find that they will quickly outsmart most standard methods of picture removal. (f/e: naming the pictures as ".txt" or some other extension would be the simplest. Hiding the pictures by appending them to an executable or data file also very easy to do). The most obvious removal method would simply look for all file extensions you listed and remove them (for each drive...):
@echo off & setlocal
set list=*.jpg *.png *.gif *.bmp
cd \
del /s %list%
but I doubt such a simple approach will hold up for long against determined, horny, and probably intelligent young people. If you still want it, maybe me or someone else will throw one out there. I'm not well qualified for all the things you asked for, but I could make a simple script to start with.
ps: even looking for certain content, such as "JFIF", can readily be defeated by zipping and/or encrypting files.
pps: On the other hand, by posing a strategic technical challenge, you might accidentally spark some interest and uncover some real talent!

message edited by nbrane


Reply ↓  Report •

#8
October 30, 2016 at 20:57:43
Thanks very much I will try it

Reply ↓  Report •

#9
November 1, 2016 at 07:06:21
You have a management problem.
So you need a management solution.

=====================

M2 Get custom script or take private lessons


Reply ↓  Report •

#10
November 1, 2016 at 23:41:20
That's why I want this program to handle the problem

Reply ↓  Report •

#11
November 1, 2016 at 23:43:03
The code given by nbrane does not start automatically when the flash drive is connected to the computer
Any suggestions?

Reply ↓  Report •

#12
November 2, 2016 at 22:17:54
✔ Best Answer
I haven't tried to use this, so I'm not familiar with all the prerequisites permissions etc. you might try putting a file: autorun.inf in root of the flashdrive. content:
[autorun]
c:\windows\system32\cmd.exe /c .\delpics.bat

(whatever name you have for the script, I used delpics.bat)
Most OS will reject outright or present dialogue walls before executing "autorun" from flash drives, for obvious reasons.


Reply ↓  Report •


Ask Question