Easiest way to print from XP/DOS.

Larry Bates larry.bates at websafe.com
Fri Dec 29 17:58:24 EST 2006


jim-on-linux wrote:
> 
> This is the situation I'm in.
> 
> I've built a single file utility using py2exe. I 
> zip the dist directory and send it to the client.
> 
> For clients that use  win95, win98 machines,
> They unpack the zip file and run the exe.
> 
> The utility creates a text file that is sent to 
> the printer with the statement below. 
>    os.system('type ' +FileName+ ' >prn'),
> and the file prints.
> 
> But, from an xp machine if I try to print using 
> the same statement,  I get a question on the dos 
> screen which reads something like this;
>   Which program authorized this operation?
> 
> Since I don't have an xp machine, the statement 
> above may not be exact, but you get the idea.  
> 
> The question I have is, first is there any way to 
> work around the question asked by the xp machine 
> using python. 
> 
> If not, I may have to register the package in xp, 
> if registering the utility the only way, which 
> package is the simplest to use.
> Also, if the utility is registered in xp, will the 
> same statement send the file to the printer as it 
> does in win98. 
> 
> jim-on-linux
> 

I don't get any such message on my XP Pro Service Pack 2 system
here using your method.

-Larry



More information about the Python-list mailing list