Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute a bat file when an image is viewed

I want to hide a bat file or its commands in a image file so when the image is opened the commands in the bat file is executed.

like image 576
Udara S.S Liyanage Avatar asked Jan 07 '12 05:01

Udara S.S Liyanage


1 Answers

Assuming you're speaking specifically for the windows platform (what with "batch" files), you can't.

Batch files are parsed, not compiled, so an image file with batch in it would still be read as an image file.

I really can't sum it up more clearly than things just don't work like this.

However, assuming you're doing things ethically, you can re-associate, say, a .jpg extension to be opened with the command prompt and put your batch script in a text file with a .jpg extension.

Just a final note: Questions like these are often looked poorly upon by the StackOverflow members simply because you're hardly ever trying to achieve something like this with good intentions. I won't be the first to flame you, but I definitely won't be the last.

like image 146
Qix - MONICA WAS MISTREATED Avatar answered Nov 03 '22 01:11

Qix - MONICA WAS MISTREATED