Jump to content
Sign in to follow this  
FuTai

How to Use AutoIT to change printer name & regedit keys

Recommended Posts

FuTai

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
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
FuTai

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
FuTai

have any simple code to change the printer name?

Share this post


Link to post
Share on other sites
water

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
FuTai

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
JLogan3o13

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!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
FuTai

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
FuTai

"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

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  

×