Sign in to follow this  
Followers 0
emendelson

Print test page fails in Vista

14 posts in this topic

#1 ·  Posted (edited)

Hello,

This AutoIt 3 script snippet works perfectly under Windows XP to print a test page, but it fails under Vista:

CODE
$a = MsgBox(270627, "Print printer test file?", "Test your default printer by printing a test file?" & @CRLF & @CRLF & _

"If you recently installed a printer, choose Yes.")

If $a = 2 Then Exit

If $a = 6 Then

$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,(LoadDriver)}!\\" & @ComputerName & "\root\cimv2")

$colInstalledPrinters = $objWMIService.ExecQuery ("Select * from Win32_Printer Where Default = True")

For $objPrinter In $colInstalledPrinters

$uResult = $objPrinter.PrintTestPage ()

Next

$a = MsgBox(270401, "Printing", "Please wait.")

If $a = 2 Then Exit

EndIf

Does anyone know a way of making it work under Vista?

Many thanks...

EDIT: Removed Func and EndFunc to make it standalone code that "just works" under XP, but does nothing under Vista (final code).

Edited by Edward Mendelson

Share this post


Link to post
Share on other sites



The final (non-beta) version of Vista has been available to developers for a few weeks. Unfortunately, the code I posted doesn't work with the final version of Vista (I never tested it with the beta versions).

Share this post


Link to post
Share on other sites

Do you mean which language version of Vista I'm using? It's US English.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The code snippet I posted above is for an AutoIt 3 script (tested in beta and shipping versions). This is an AutoIt 3 support forum, and I assumed that it would be clear that I was writing about AutoIt 3 code running in Vista. Is there something essential that I haven't said?

To make it clear what programming language I'm using: The code snippet here is an AutoIt 3 script, not anything else.

(I suppose I should be grateful for all these replies, because they keep this thread near the top of the list. But I'm not sure that any actual *information* was added at any point along the way.)

Edited by Edward Mendelson

Share this post


Link to post
Share on other sites

Yeah, I said the Vista release (developers) sorta only works for some programming languages, but it doesnt matter. Just ignore that bit I guess. I have just installed Vista on my desktop(with printer) so I will try it now, and see if I can get anything to work.

Share this post


Link to post
Share on other sites

where are people getting free vista anyway? (meaning release version)

because I sure would like to try it out


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

Vista final code is available to developers who subscribe to MSDN (msdn.microsoft.com).

Share this post


Link to post
Share on other sites

Alot of people have had problems with some of their scripts in Vista, but do remember that Vista is still beta. Its the same with a program called Game Maker.

Can you please not spread misinformation like this? There are not a lot of people have trouble with Vista and you well know Vista is not in beta any longer. If you're going to try to help - help, don't confuse things further like you've done in this thread. And saying only some languages work on Vista? What kind of delusional crap is that?

Share this post


Link to post
Share on other sites

Can you please not spread misinformation like this? There are not a lot of people have trouble with Vista and you well know Vista is not in beta any longer. If you're going to try to help - help, don't confuse things further like you've done in this thread. And saying only some languages work on Vista? What kind of delusional crap is that?

The other piece of misinformation is that only RC1/RC2 are available at MSDN. Final code has been available to paying MSDN members for weeks. (It's not available as a free download; it's available to subscribers).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0