Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Running a C# executable that requires parameters

$
0
0

I have a C# executable that I need to run within a PowerShell script. It has 3 parameters.

When I would execute this inside of a .bat file, it looks like this:

ConvertPPTXtoPDF.exe "M1-Overview\Slides\M 01-Overview.pptx" "DevWS\Overview\Slides\M 01-Overview_Handouts.pdf" "Handouts"

Basically, I take the .pptx, convert it to a pdf that is setup as a handout and save it to the _Handouts.pdf file.

I've been trying to figure out how to get this to run and what it seems is that I should be able to start with an '&' character and then separate the .exe and parameters with '' and spaces like this:

& 'ConvertPPTXtoPDF.exe' 'M1-Overview\Slides\M 01-Overview.pptx' 'DevWS\Overview\Slides\M 01-Overview_Handouts.pdf' Handouts'

However, this does not work, it tells me that it cannot find a positional parameter that starts with 'M1-Overview... etc.

What would be the correct syntax for getting this to run?

Thanks!


STom


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>