bris
bris

Reputation: 11

Running an exe with dynamic arguments

I would like to execute this command:

dot -Tjpg C:\wamp\www\schoolmate\pixy\graphs\xss_index.php_1_min.dot > C:\wamp\www\schoolmate\pixy\graphs\xss_index.php_1_min.jpg 

For all the files in the directory. The names of the output files should be the same as the input file except for the extension.

Upvotes: 1

Views: 42

Answers (1)

Etan Reisner
Etan Reisner

Reputation: 81012

Something like this should work (untested):

get-childitem c:\wamp\www\schoolmate\pixy\graphs\*.dot | % {
    & dot -Tjpg $_ > "$($_.Directory)\$($_.BaseName).jpg"
}

Upvotes: 1

Related Questions