Can you run a command line program from shell without writing a .bat file disk and calling the .bat file with the Shell( ) method?
I would like to create my command string and run it without having to write any temporary files to disk if at all possible. Also, I would like to capture the command's return string (if any) without using a temporary file if possible.
I am sending a file to a printer using the Lpr command. In code I generate a string such as "Lpr -S $PrinterIP -P $Queue "$PathToFile" >> "$OutputFile"", I write this string to a .bat file, run the .bat file with the Shell( ) method, check the contents of $OutputFile, and delete $OutputFile and the .bat file.
There has to be a better, cleaner, way.
I would like to create my command string and run it without having to write any temporary files to disk if at all possible. Also, I would like to capture the command's return string (if any) without using a temporary file if possible.
I am sending a file to a printer using the Lpr command. In code I generate a string such as "Lpr -S $PrinterIP -P $Queue "$PathToFile" >> "$OutputFile"", I write this string to a .bat file, run the .bat file with the Shell( ) method, check the contents of $OutputFile, and delete $OutputFile and the .bat file.
There has to be a better, cleaner, way.