Automate printing Mathcad sheets to PDF
I am trying to print all files in certain format (i.e. *.xmcd) in a folder to PDF. I already made AdobePDF my default printer. I want to do this task using powershell but I when I run it I get the an error, which I think has to do something with Mathcad software.
I also added VBScript tag since as I am moving forward with this. I more think about using visual basic for this purpose.
This is the command:
Start-Process -FilePath “internal.company.compathtothefile.xmcd” –Verb Print -PassThru | %{sleep 10;$_} | kill
And the error that I get:

It basically should get the file, start printing and after 10 seconds close the application.
I also tried cygwin and cygstart like below but it gives me an error;
cygstart --print myfile.xmcd
and the error is: Unable to start 's.xmcd': The DDE transaction failed.
First step is to figure out a way to print mathcad sheet using powershell or batch/bash script.
Note: Mathcad sheets have XML format.
Note-2: Out-Print gives a pdf of the xml.
Note-3: cmd.exe /C ASSOC .xmcd gives me .xmcd=Mathcad.
And, cmd.exe /c ftype Mathcad gives me Mathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde.
powershell cmd.exe cygwin vbscript mathcad
migrated from stackoverflow.com May 9 '17 at 16:22
This question came from our site for professional and enthusiast programmers.
|
show 9 more comments
I am trying to print all files in certain format (i.e. *.xmcd) in a folder to PDF. I already made AdobePDF my default printer. I want to do this task using powershell but I when I run it I get the an error, which I think has to do something with Mathcad software.
I also added VBScript tag since as I am moving forward with this. I more think about using visual basic for this purpose.
This is the command:
Start-Process -FilePath “internal.company.compathtothefile.xmcd” –Verb Print -PassThru | %{sleep 10;$_} | kill
And the error that I get:

It basically should get the file, start printing and after 10 seconds close the application.
I also tried cygwin and cygstart like below but it gives me an error;
cygstart --print myfile.xmcd
and the error is: Unable to start 's.xmcd': The DDE transaction failed.
First step is to figure out a way to print mathcad sheet using powershell or batch/bash script.
Note: Mathcad sheets have XML format.
Note-2: Out-Print gives a pdf of the xml.
Note-3: cmd.exe /C ASSOC .xmcd gives me .xmcd=Mathcad.
And, cmd.exe /c ftype Mathcad gives me Mathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde.
powershell cmd.exe cygwin vbscript mathcad
migrated from stackoverflow.com May 9 '17 at 16:22
This question came from our site for professional and enthusiast programmers.
What is the output of the command& cmd.exe /C ASSOC .xmcd? Have you investigatedOut-Printer?
– lit
May 8 '17 at 17:34
@litOut-Printerprints the XML format of the file. I think I need to somehow open the file with Mathcad.exe and then print it.
– M-M
May 8 '17 at 17:47
@lit I added output ofcmd.exe /C ASSOC .xmcdin the question.
– M-M
May 8 '17 at 17:51
What is the output of& cmd.exe /c ftype Mathcad?
– lit
May 8 '17 at 18:02
@litMathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde
– M-M
May 8 '17 at 18:05
|
show 9 more comments
I am trying to print all files in certain format (i.e. *.xmcd) in a folder to PDF. I already made AdobePDF my default printer. I want to do this task using powershell but I when I run it I get the an error, which I think has to do something with Mathcad software.
I also added VBScript tag since as I am moving forward with this. I more think about using visual basic for this purpose.
This is the command:
Start-Process -FilePath “internal.company.compathtothefile.xmcd” –Verb Print -PassThru | %{sleep 10;$_} | kill
And the error that I get:

It basically should get the file, start printing and after 10 seconds close the application.
I also tried cygwin and cygstart like below but it gives me an error;
cygstart --print myfile.xmcd
and the error is: Unable to start 's.xmcd': The DDE transaction failed.
First step is to figure out a way to print mathcad sheet using powershell or batch/bash script.
Note: Mathcad sheets have XML format.
Note-2: Out-Print gives a pdf of the xml.
Note-3: cmd.exe /C ASSOC .xmcd gives me .xmcd=Mathcad.
And, cmd.exe /c ftype Mathcad gives me Mathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde.
powershell cmd.exe cygwin vbscript mathcad
I am trying to print all files in certain format (i.e. *.xmcd) in a folder to PDF. I already made AdobePDF my default printer. I want to do this task using powershell but I when I run it I get the an error, which I think has to do something with Mathcad software.
I also added VBScript tag since as I am moving forward with this. I more think about using visual basic for this purpose.
This is the command:
Start-Process -FilePath “internal.company.compathtothefile.xmcd” –Verb Print -PassThru | %{sleep 10;$_} | kill
And the error that I get:

It basically should get the file, start printing and after 10 seconds close the application.
I also tried cygwin and cygstart like below but it gives me an error;
cygstart --print myfile.xmcd
and the error is: Unable to start 's.xmcd': The DDE transaction failed.
First step is to figure out a way to print mathcad sheet using powershell or batch/bash script.
Note: Mathcad sheets have XML format.
Note-2: Out-Print gives a pdf of the xml.
Note-3: cmd.exe /C ASSOC .xmcd gives me .xmcd=Mathcad.
And, cmd.exe /c ftype Mathcad gives me Mathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde.
powershell cmd.exe cygwin vbscript mathcad
powershell cmd.exe cygwin vbscript mathcad
edited Jan 23 at 19:52
M-M
asked May 8 '17 at 14:16
M-MM-M
16710
16710
migrated from stackoverflow.com May 9 '17 at 16:22
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com May 9 '17 at 16:22
This question came from our site for professional and enthusiast programmers.
What is the output of the command& cmd.exe /C ASSOC .xmcd? Have you investigatedOut-Printer?
– lit
May 8 '17 at 17:34
@litOut-Printerprints the XML format of the file. I think I need to somehow open the file with Mathcad.exe and then print it.
– M-M
May 8 '17 at 17:47
@lit I added output ofcmd.exe /C ASSOC .xmcdin the question.
– M-M
May 8 '17 at 17:51
What is the output of& cmd.exe /c ftype Mathcad?
– lit
May 8 '17 at 18:02
@litMathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde
– M-M
May 8 '17 at 18:05
|
show 9 more comments
What is the output of the command& cmd.exe /C ASSOC .xmcd? Have you investigatedOut-Printer?
– lit
May 8 '17 at 17:34
@litOut-Printerprints the XML format of the file. I think I need to somehow open the file with Mathcad.exe and then print it.
– M-M
May 8 '17 at 17:47
@lit I added output ofcmd.exe /C ASSOC .xmcdin the question.
– M-M
May 8 '17 at 17:51
What is the output of& cmd.exe /c ftype Mathcad?
– lit
May 8 '17 at 18:02
@litMathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde
– M-M
May 8 '17 at 18:05
What is the output of the command
& cmd.exe /C ASSOC .xmcd? Have you investigated Out-Printer?– lit
May 8 '17 at 17:34
What is the output of the command
& cmd.exe /C ASSOC .xmcd? Have you investigated Out-Printer?– lit
May 8 '17 at 17:34
@lit
Out-Printer prints the XML format of the file. I think I need to somehow open the file with Mathcad.exe and then print it.– M-M
May 8 '17 at 17:47
@lit
Out-Printer prints the XML format of the file. I think I need to somehow open the file with Mathcad.exe and then print it.– M-M
May 8 '17 at 17:47
@lit I added output of
cmd.exe /C ASSOC .xmcd in the question.– M-M
May 8 '17 at 17:51
@lit I added output of
cmd.exe /C ASSOC .xmcd in the question.– M-M
May 8 '17 at 17:51
What is the output of
& cmd.exe /c ftype Mathcad?– lit
May 8 '17 at 18:02
What is the output of
& cmd.exe /c ftype Mathcad?– lit
May 8 '17 at 18:02
@lit
Mathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde– M-M
May 8 '17 at 18:05
@lit
Mathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde– M-M
May 8 '17 at 18:05
|
show 9 more comments
1 Answer
1
active
oldest
votes
I found a way to do this;
for %f in (*.xmcd) do "C:Program Files (x86)MathcadMathcad 15mathcad.exe" -p %f
It will prompt the save dialog and you need to hit OK to save it as PDF (or send it to your default printer).
It is wise to not run so many files (10~20 would be good) at the same time as it may causes some errors including licensing but not limited to that.
Glad you found a way. I am not sure why you would want to wait. Does every "print" b mathcad.exe cause a dialog box to appear, or is that from the Adobe PDF printer driver?
– lit
May 9 '17 at 22:10
@lit it's from Adob PDF.
– M-M
May 9 '17 at 22:31
This may be relevant. khkonsulting.com/2013/01/…
– lit
May 9 '17 at 22:36
@lit Indeed it is. But unfortunately we don't have admin access to registry on company's machines. But anyhow, I now know it is possible. Thank you for your help.
– M-M
May 10 '17 at 0:21
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1207549%2fautomate-printing-mathcad-sheets-to-pdf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found a way to do this;
for %f in (*.xmcd) do "C:Program Files (x86)MathcadMathcad 15mathcad.exe" -p %f
It will prompt the save dialog and you need to hit OK to save it as PDF (or send it to your default printer).
It is wise to not run so many files (10~20 would be good) at the same time as it may causes some errors including licensing but not limited to that.
Glad you found a way. I am not sure why you would want to wait. Does every "print" b mathcad.exe cause a dialog box to appear, or is that from the Adobe PDF printer driver?
– lit
May 9 '17 at 22:10
@lit it's from Adob PDF.
– M-M
May 9 '17 at 22:31
This may be relevant. khkonsulting.com/2013/01/…
– lit
May 9 '17 at 22:36
@lit Indeed it is. But unfortunately we don't have admin access to registry on company's machines. But anyhow, I now know it is possible. Thank you for your help.
– M-M
May 10 '17 at 0:21
add a comment |
I found a way to do this;
for %f in (*.xmcd) do "C:Program Files (x86)MathcadMathcad 15mathcad.exe" -p %f
It will prompt the save dialog and you need to hit OK to save it as PDF (or send it to your default printer).
It is wise to not run so many files (10~20 would be good) at the same time as it may causes some errors including licensing but not limited to that.
Glad you found a way. I am not sure why you would want to wait. Does every "print" b mathcad.exe cause a dialog box to appear, or is that from the Adobe PDF printer driver?
– lit
May 9 '17 at 22:10
@lit it's from Adob PDF.
– M-M
May 9 '17 at 22:31
This may be relevant. khkonsulting.com/2013/01/…
– lit
May 9 '17 at 22:36
@lit Indeed it is. But unfortunately we don't have admin access to registry on company's machines. But anyhow, I now know it is possible. Thank you for your help.
– M-M
May 10 '17 at 0:21
add a comment |
I found a way to do this;
for %f in (*.xmcd) do "C:Program Files (x86)MathcadMathcad 15mathcad.exe" -p %f
It will prompt the save dialog and you need to hit OK to save it as PDF (or send it to your default printer).
It is wise to not run so many files (10~20 would be good) at the same time as it may causes some errors including licensing but not limited to that.
I found a way to do this;
for %f in (*.xmcd) do "C:Program Files (x86)MathcadMathcad 15mathcad.exe" -p %f
It will prompt the save dialog and you need to hit OK to save it as PDF (or send it to your default printer).
It is wise to not run so many files (10~20 would be good) at the same time as it may causes some errors including licensing but not limited to that.
edited May 10 '17 at 0:24
answered May 9 '17 at 21:08
M-MM-M
16710
16710
Glad you found a way. I am not sure why you would want to wait. Does every "print" b mathcad.exe cause a dialog box to appear, or is that from the Adobe PDF printer driver?
– lit
May 9 '17 at 22:10
@lit it's from Adob PDF.
– M-M
May 9 '17 at 22:31
This may be relevant. khkonsulting.com/2013/01/…
– lit
May 9 '17 at 22:36
@lit Indeed it is. But unfortunately we don't have admin access to registry on company's machines. But anyhow, I now know it is possible. Thank you for your help.
– M-M
May 10 '17 at 0:21
add a comment |
Glad you found a way. I am not sure why you would want to wait. Does every "print" b mathcad.exe cause a dialog box to appear, or is that from the Adobe PDF printer driver?
– lit
May 9 '17 at 22:10
@lit it's from Adob PDF.
– M-M
May 9 '17 at 22:31
This may be relevant. khkonsulting.com/2013/01/…
– lit
May 9 '17 at 22:36
@lit Indeed it is. But unfortunately we don't have admin access to registry on company's machines. But anyhow, I now know it is possible. Thank you for your help.
– M-M
May 10 '17 at 0:21
Glad you found a way. I am not sure why you would want to wait. Does every "print" b mathcad.exe cause a dialog box to appear, or is that from the Adobe PDF printer driver?
– lit
May 9 '17 at 22:10
Glad you found a way. I am not sure why you would want to wait. Does every "print" b mathcad.exe cause a dialog box to appear, or is that from the Adobe PDF printer driver?
– lit
May 9 '17 at 22:10
@lit it's from Adob PDF.
– M-M
May 9 '17 at 22:31
@lit it's from Adob PDF.
– M-M
May 9 '17 at 22:31
This may be relevant. khkonsulting.com/2013/01/…
– lit
May 9 '17 at 22:36
This may be relevant. khkonsulting.com/2013/01/…
– lit
May 9 '17 at 22:36
@lit Indeed it is. But unfortunately we don't have admin access to registry on company's machines. But anyhow, I now know it is possible. Thank you for your help.
– M-M
May 10 '17 at 0:21
@lit Indeed it is. But unfortunately we don't have admin access to registry on company's machines. But anyhow, I now know it is possible. Thank you for your help.
– M-M
May 10 '17 at 0:21
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1207549%2fautomate-printing-mathcad-sheets-to-pdf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What is the output of the command
& cmd.exe /C ASSOC .xmcd? Have you investigatedOut-Printer?– lit
May 8 '17 at 17:34
@lit
Out-Printerprints the XML format of the file. I think I need to somehow open the file with Mathcad.exe and then print it.– M-M
May 8 '17 at 17:47
@lit I added output of
cmd.exe /C ASSOC .xmcdin the question.– M-M
May 8 '17 at 17:51
What is the output of
& cmd.exe /c ftype Mathcad?– lit
May 8 '17 at 18:02
@lit
Mathcad="C:Program Files (x86)MathcadMathcad 15mathcad.exe" /dde– M-M
May 8 '17 at 18:05