Sign in to follow this  
Followers 0
FuTai

How to Use AutoIT to change printer name & regedit keys

11 posts in this topic

Dear All,

I'm new user to using this autoIT program, I wanna use this program to write a function to change printername & Regedit keys

EG:

Printer1 ==> Printer2

regedit keys 01 => 02.

Please help me for this issue. thanks.

Regards,

Frank Ng :thumbsup:

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

Please use the search function (e.g. search for "set default printer") and you will find a lot of threads with example code.

Something like


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Welcome to AutoIt and the forum!

Please use the search function (e.g. search for "set default printer") and you will find a lot of threads with example code.

Something like

Thank you very Much :guitar:

Have a good day~

Share this post


Link to post
Share on other sites

have any simple code to change the printer name?

Share this post


Link to post
Share on other sites

That's a locally attached printer not a network printer?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

That's a locally attached printer not a network printer?

Local Printer :sweating: Just for rename printer

Share this post


Link to post
Share on other sites

Something like this should work (untested):

$WMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2")
$aPrinters = $WMI.ExecQuery("Select * From Win32_Printer Where DeviceID = 'HP'")

 For $element in $aPrinters
  $element.RenamePrinter("ArtDepartmentPrinter")
 Next

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Something like this should work (untested):

$WMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2")
$aPrinters = $WMI.ExecQuery("Select * From Win32_Printer Where DeviceID = 'HP'")

For $element in $aPrinters
$element.RenamePrinter("ArtDepartmentPrinter")
Next

No worked. I'm using OS XP.

Share this post


Link to post
Share on other sites

"No worked" doesn't exactly tell us much, does it :) What error are you seeing?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

"No worked" doesn't exactly tell us much, does it :) What error are you seeing?

Dear, Thanks for your help, I have one printer only for the system, but I need to change the printer name to "PrinterA","PrinterB" or PrinterC..etc.because the system printing is point to Server database "printer Name", this is for client use. :)

Share this post


Link to post
Share on other sites

You still haven't told us what "No worked" means. What error are you receiving when you run the code I supplies in post #7?


√-1 2^3 ∑ π, and it was delicious!

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