![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | printing a file created by the windows printing dialog (print to f Hi, I have printed a PDF-File by using the Windows print dialog using the option "print to file". In the windows command processor I can print this file with: copy /b "c:\test.prn" \\servername\printername The question now was, how can I do this in powershell? My idea was: get-content -path "c:\test.prn" | out-printer But this only works if the file is a textfile. A switch like /b (binary) as for the copy-command dosent exist in powershell. I think a similar parameter for the get-content cmdlet should be -encoding, but there is no value possible that equals binary. Has anybody an idea how to get the problem solved? Many thaks in advance. jho |
My System Specs![]() |
| | #2 (permalink) |
| | Re: printing a file created by the windows printing dialog (print to f powershell have full support for CMD command. As example: cmd /c "copy /b "c:\test.prn" \\servername\printername" -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "jho" <jho@xxxxxx> rakstīja ziņojumā "news:8D484684-F62F-4B2F-9637-80D77441C3AE@xxxxxx"... Quote: > Hi, > > I have printed a PDF-File by using the Windows print dialog using the > option > "print to file". > > In the windows command processor I can print this file with: > copy /b "c:\test.prn" \\servername\printername > > The question now was, how can I do this in powershell? > > My idea was: > get-content -path "c:\test.prn" | out-printer > > But this only works if the file is a textfile. > A switch like /b (binary) as for the copy-command dosent exist in > powershell. > I think a similar parameter for the get-content cmdlet should > be -encoding, > but there is no value possible that equals binary. > > Has anybody an idea how to get the problem solved? > > Many thaks in advance. > > jho > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: printing a file created by the windows printing dialog (print Many thanks Mr. Podans, but I want to know how do I this with the cmdlets of powerschell. "Vadims Podans [MVP]" wrote: Quote: > powershell have full support for CMD command. As example: > cmd /c "copy /b "c:\test.prn" \\servername\printername" > -- > WBR, Vadims Podans > MVP: PowerShell > PowerShell blog - www.sysadmins.lv > > "jho" <jho@xxxxxx> rakstīja ziņojumā > "news:8D484684-F62F-4B2F-9637-80D77441C3AE@xxxxxx"... Quote: > > Hi, > > > > I have printed a PDF-File by using the Windows print dialog using the > > option > > "print to file". > > > > In the windows command processor I can print this file with: > > copy /b "c:\test.prn" \\servername\printername > > > > The question now was, how can I do this in powershell? > > > > My idea was: > > get-content -path "c:\test.prn" | out-printer > > > > But this only works if the file is a textfile. > > A switch like /b (binary) as for the copy-command dosent exist in > > powershell. > > I think a similar parameter for the get-content cmdlet should > > be -encoding, > > but there is no value possible that equals binary. > > > > Has anybody an idea how to get the problem solved? > > > > Many thaks in advance. > > > > jho > > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: printing a file created by the windows printing dialog (print Get-Content cmdlet has -Encoding paramter in PowerShell V2. In PowerShell 1.0 you can use readAllText method in io.file class: http://msdn.microsoft.com/en-us/library/ms143369.aspx -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "jho" <jho@xxxxxx> rakstīja ziņojumā "news FAC9497-5BE7-44FA-B1B6-99CBDE4E2CA3@xxxxxx"...Quote: > Many thanks Mr. Podans, but I want to know how do I this with the cmdlets > of > powerschell. > > "Vadims Podans [MVP]" wrote: > Quote: >> powershell have full support for CMD command. As example: >> cmd /c "copy /b "c:\test.prn" \\servername\printername" >> -- >> WBR, Vadims Podans >> MVP: PowerShell >> PowerShell blog - www.sysadmins.lv >> >> "jho" <jho@xxxxxx> rakstīja ziņojumā >> "news:8D484684-F62F-4B2F-9637-80D77441C3AE@xxxxxx"... Quote: >> > Hi, >> > >> > I have printed a PDF-File by using the Windows print dialog using the >> > option >> > "print to file". >> > >> > In the windows command processor I can print this file with: >> > copy /b "c:\test.prn" \\servername\printername >> > >> > The question now was, how can I do this in powershell? >> > >> > My idea was: >> > get-content -path "c:\test.prn" | out-printer >> > >> > But this only works if the file is a textfile. >> > A switch like /b (binary) as for the copy-command dosent exist in >> > powershell. >> > I think a similar parameter for the get-content cmdlet should >> > be -encoding, >> > but there is no value possible that equals binary. >> > >> > Has anybody an idea how to get the problem solved? >> > >> > Many thaks in advance. >> > >> > jho >> > >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Printing small file turns in to huge file in print queue | Vista General | |||
| Error in Printing using "Print To File" and RAW Print mode | Vista print fax & scan | |||
| How do I stop Vista using print to file as default when printing | Vista General | |||
| Fix for printing Works doc created another problem (Vista) | Vista General | |||
| Printing to printers on a windows 2003 print server | Vista networking & sharing | |||