Hello,
I'm trying to uninstall a shared printer from a package on the server, but the following command returns "access denied" when I test it (even in cmd as administrator): `
run(r'rundll32 printui.dll,PrintUIEntry /dl /n "\\172.18.80.1\Pedagogique EDS"')`.
Do you know of another method?
The installation using the command below works, however:
`run(r'rundll32 printui.dll,PrintUIEntry /in /q /n "\\172.18.80.1\Pedagogique EDS"')`.
Remove network printer
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
The printer is linked to the user account, right?
Ah yes, that's possible... Ultimately, the printer installation isn't working either. I tested it by right-clicking on "install" in PyScripter, but when installing the package on one machine, nothing is installed. Do I need to put that in session_setup?
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
When you test with PyScripter, you run the command as the current user.
Therefore, you've installed the printer in that user's session.
When you deploy your package, it's executed under the system account.
So yes, session_setup is indeed the solution.
Therefore, you've installed the printer in that user's session.
When you deploy your package, it's executed under the system account.
So yes, session_setup is indeed the solution.
So the installation works in session_setup, but it is not silent despite the "/q" in the command, which is annoying because the user can cancel (and some will!
)
So deletion isn't possible in this package then?
So deletion isn't possible in this package then?
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
print('Lancement client Papercut au demarrage')
registry_set(HKEY_LOCAL_MACHINE,"software\\Microsoft\\Windows\\CurrentVersion\\Run\\","UIT","\\\\172.18.80.1\PCClient\win\pc-client-local-cache.exe")
def uninstall():
print('Suppression valeur de registre UIT au demarrage')
registry_delete(HKEY_LOCAL_MACHINE,"software\\Microsoft\\Windows\\CurrentVersion\\Run\\","UIT")
run(r'rundll32 printui.dll,PrintUIEntry /dl /n "\\172.18.80.1\Pedagogique EDS"')
def session_setup():
print('Ajout des zones Intranet dans IE')
run (r'regedit.exe /s \\172.16.80.1\netlogon\scripts\registre\ZoneIntranetIE.reg')
run(r'rundll32 printui.dll,PrintUIEntry /in /q /n "\\172.18.80.1\Pedagogique EDS"')- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
Nothing is executed by wapt when the session closes, so no.
To be honest, I don't use wapt for printers.
I use a VBScript at login and login, or with GPOs
.
To be honest, I don't use wapt for printers.
I use a VBScript at login and login, or with GPOs
.
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
You can, however, install a logout script with Wapt!
It looks tricky though, to comply with Microsoft standards.
You can take an example from add_shutdown_script (computer shutdown script):
https://dev.tranquil.it/sphinxdocs/_mod ... own_script
It looks tricky though, to comply with Microsoft standards.
You can take an example from add_shutdown_script (computer shutdown script):
https://dev.tranquil.it/sphinxdocs/_mod ... own_script
