pdftex miktex shell-escape – How to Run Shell Command with \write18

miktexpdftexshell-escape

I want to use the command \write18 with shell or other excutables rather than only a restricted list of programs as it says here: https://tex.stackexchange.com/a/20446/92620

How can i bypass the restrictions set on \write18 to execute external/shell from documents ?

EDIT:

I got this line from the log file:

runsystem(cmd.exe)…disabled (restricted).

\documentclass{report}
\immediate\write18{cmd.exe}
\begin{document}
...
\end{document}

Best Answer

I don't think that cmd.exe was ever directly allowed (in restricted mode). You need to run your document with --shell-escape.

When I try your document I get a prompt in the window where pdflatex compiled the document.

If you want a new cmd.exe windows you should probably use

\immediate\write18{start cmd.exe} 

(again --shell-escape is needed).