I'd like to remove around 2,400 printers from the database (that were added before I discovered the "ignore printers" option, and was wondering if there is a way I can write or get a script to delete them?
1. The first option is of course, manual hard labor!
2. If your setup is now and just in testing at the moment, one simple option could be simply uninstall and re-install resetting the data.
3. You can use the following SQL command to delete all printers:
i) Manually stop the "
PaperCut Application Server Service" under Control Panel -> Admin Tools -> Services
ii) Open a command prompt
iii) cd C:\Program Files\
PaperCut NG\server\bin\win
iv)
db-tools run-sql "UPDATE tbl_printer SET deleted = 'Y' WHERE display_name = 'server\printer'"
v) Repeat line above for each printer
Note: One trick is to maybe use an exported list of printers in EXCEL and a simple string join formula to generate the list of commands, then save the text as a batch file.
4. Or a partial list of printers matching a substring (Advanced SQL) using same procedure as 3:
db-tools run-sql "UPDATE tbl_printer SET deleted = 'Y' WHERE display_name LIKE '%server_name%' "
5. Or all printers:
db-tools run-sql "UPDATE tbl_printer SET deleted = 'Y'"
keywords: delete, bulk delete, remove multiple printers