Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using MiKTeX portable 2.9 with TexStudio in Windows 7 without administrator permission. When I try to use ps2pdf, I get the following error:

"mgs.exe is not recognizable as an internal or external command".

I think I have configured it right (as all other commands - pdflatex, latex, etc - are running well). I guess this is because I don't have administrator permission, but I'm not sure. And if this is the problem, does anyone have a solution?

share|improve this question
add comment

7 Answers

I have my students using Portable Miktex 2.9 with Texmaker. And the entry on the ps2pdf is

 "../MikTexPortable/miktex/bin/ps2pdf" %.ps

I have both Texmaker and Texstudio configured on my clip and I use successfully the exact same entry.

I configured my clip initially on an XP box and then copied it to a server so students could download it to their clip. It successfully runs on XP, Vista, and Win 7 both from a clip or with the folder copied onto the computers hard drive.

The important item is that your configuration for TeXStudio and all other software required must not touch the registry or access any programs connected to the registry. (In XP and Vista this was not a tightly enforced, but Win 7 has a much more diligent internal security model. [a good thing])

As a side note: I still have not been able to do a non-portable install of MikTeX 2.9 on any Windows 7 machine on my campus because of the additional security options selected (so far I can not get a waiver) by the University System Admin.

share|improve this answer
    
Thanks. This is exactly the entry I have used. So, if I understood, the problem is that my configuration is touching the registry. Are there any way to avoid this? –  raphael Mar 27 '12 at 19:03
add comment

I am also facing this problem. Haven't yet found the solution, but after some debugging, I have found the cause of problem.

The ps2pdf command in miktex uses ghostscript to generate a pdf. It uses an internal ghostscript converter 'mgs.exe' found in the same miktex/bin directory. So, if you try to convert a ps to pdf while in the bin directory, the command will work successfully. But when using this command through an editor, like TeXstudio, the working directory is different. Thats why mgs.exe is not found.

Now, a possible solution would be to temporarily add the miktex/bin directory to path. But I am not sure you could do it without admin rights.

share|improve this answer
add comment

I am also struggling with this, but I got by with just using mgs.exe directly instead of the wrapper ps2pdf. See this post: Configuring portable TeXstudio to use MiKTeX portable

My ps2pdf entry in TeXmaker is set to:

MIKTEX\miktex\bin\mgs -sDEVICE=pdfwrite -o %.pdf %.ps

Maybe this is bad form, but it seems to work. I am curious if you have any thoughts on this or come up with other solutions?

share|improve this answer
add comment

I've just faced the same problem but I'm using Texmaker as editor. Following Ammar's suggestion, I added the miktex bin folder to the path so mgs could be found during the ps2pdf conversion. However, Texmaker gives the option "Add to PATH" in its settings tab, so it isn't necessary to edit the system variable, thus avoiding security problems.

It worked on Windows XP, with Miktex portable 2.9.4250 and Texmaker 3.5.2

share|improve this answer
add comment

Just use below command and save as batch file with name ps2pdf.bat. Adjust path to MiKTeX.

FOR %%c in (*.ps) DO C:\MiKTeX2.8\texmf\miktex\bin\ps2pdf.exe %%c

Call this batch file in Texmaker.

share|improve this answer
    
Welcome to TeX.SX! –  Papiro Sep 10 '13 at 9:15
    
Thanks Papiro!! –  Ray Anthony Leong Sep 11 '13 at 7:45
add comment

I am using Windows 8, TexMaker and Miktex Portable. I did "Add to PATH" by configuring Texmaker, I added g:/MiktexPortable/miktex/bin/ to it and the mgs.exe problem seems to be resolved. The path must be adjusted, of course.

share|improve this answer
add comment

I was struggling with the same problem and the linked article helped me to solve the problem. Apparently the problem is that we use portable version. http://robertmarkbramprogrammer.blogspot.ch/2008/01/xxx-is-not-recognized-as-internal-or.html

share|improve this answer
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Speravir Apr 8 at 23:11
    
Link only answers are discouraged here. Also we try to add self-contained answers. Hence it would be much appreciated, if you’d enhance your answer: What part of the linked blog post did help you and how did you set up your system? –  Speravir Apr 8 at 23:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.