Link to home
Create AccountLog in
Avatar of collage_jeanz
collage_jeanzFlag for Canada

asked on

Need a Batch file to find and remove "Lexmark" entries from Registry

I need a batch file, which will find and delete all the registry keys where ever lexmark is mentioned, weather its a folder, string value or DWORD value and then It should create a text file under c:\windows\logs\Lexmarkreg.txt of the keys got deleted.

Please mention if there is anyway to give full permission to everyone in registry with the batch file as well.
 
Permissions-in-Registry.jpg
Avatar of h4mi
h4mi
Flag of Sweden image

This link should assist - read the comments -- really funny banter as well

http://www.computing.net/answers/programming/delete-a-registry-key-with-batch/8218.html

.Dave
Avatar of collage_jeanz

ASKER

I am sorry, I have no idea about VB Scripting, if you can mention where I have to put Lexmark instead it asks me to provide something, what needs to be deleted. That would be greatly appriciated.
Avatar of johnb6767
"Please mention if there is anyway to give full permission to everyone in registry with the batch file as well."

Why in the world would you want to do this?
Sorry, didn't mean to sound disrespectful, but the registry is designed with granular permissions for a reason. If you open it to Everyone/Full, I can probably guess as to how soon you will be rebuilding that box. Plus, a savvy user can reverse and deny any GPO you want to try and enforce...

This would be easier to identify the keys deleted, and script a removal of only those...

Most commonly, the only thing that Lexmark drops on a system that interferes with the spooler, is the lexbce (sp?) Service, and once the driver is removed, the dependency is not....

Other things like Print monitors are usually harmless....

You might find yourself deleting more good than remnants...

Can you explain more of your end goal?
 
Thanks for the reply Johnb6767. The only reason I was thinking to give full permissions to everyone bcoz I found couple of registry entries, and I made a script to remove some entries, but inorder to remove some entries it needs to have full permission, i was thinking to give full permission in the beging of my script and then remove it by the end of it.

Well the end result I am looking for, to delete all the entries of Lexmark from Registry with just one double click.
So you have a list of the keys? Subinacl can grant access to individual keys, with no problem.

Like this....

subinacl /subkeyreg "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies" /grant=domain\%username%
Feel free to post your list of keys as well....
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Microsoft\MSPaper 12.0\ScannerApp]

[-HKEY_CURRENT_USER\Software\Microsoft\MSPaper 12.0\ScannerApp\Black and white]

[-HKEY_CURRENT_USER\Software\Microsoft\MSPaper 12.0\ScannerApp\Black and white from color page]

[-HKEY_CURRENT_USER\Software\Microsoft\MSPaper 12.0\ScannerApp\Color]

[-HKEY_CURRENT_USER\Software\Microsoft\MSPaper 12.0\ScannerApp\Grayscale]

[-HKEY_CURRENT_USER\Software\Microsoft\MSPaper 12.0\XSCAN32\Lexmark S300-S400 Series TWAIN]

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices]
"Lexmark S300-S400 Series"="winspool,Ne06:"=-

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts]
"Lexmark S300-S400 Series"="winspool,Ne06:,15,45"=-

[-HKEY_CURRENT_USER\Software\Lexmark]

[-HKEY_LOCAL_MACHINE\SOFTWARE\LexmarkInkjet]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Lexmark]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Media Device Manager\Plugins\SP\MSPMSP\KBDeviceList]
"Lexmark"="Parallel; Flash Unit;"=-

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache]
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices]
"LexmarkS300-S400 Series"="winspool,Ne00:"=-
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts]
"LexmarkS300-S400 Series"="winspool,Ne00:,15,45"=-
[-HKEY_LOCAL_MACHINE\SOFTWARE\Lexmark]
[-HKEY_LOCAL_MACHINE\SOFTWARE\LexmarkInkjet]
[-HKEY_LOCAL_MACHINE\SOFTWARE\LexmarkInkjet\JSW\Local\lxea]
[-HKEY_LOCAL_MACHINE\SOFTWARE\LexmarkInkjet\lxea]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders]
"C:\Program Files\Lexmark S300-S400 Series\"=""=-
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E979-E325-11CE-BFC1-08002BE10318}\0004]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}\0006]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}\##?#USB#Vid_043d&Pid_0180&MI_01#6&2667223e&0&0001#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}\##?#USB#Vid_043d&Pid_0180&MI_01#6&2667223e&0&0001#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ebbb9c&0&90T4099K0398823&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ebbb9c&0&90T4099K0398823&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Environments\Windows NT x86\Drivers\Version-3\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Environments\Windows NT x86\Print Processors\Lexmark S300-S400 Series Print Processor]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Printers\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\Vid_043d&Pid_0180&MI_00]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBPRINT\LexmarkS300-S400_Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBSTOR\Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\Print\Printers\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles\Current\System\CurrentControlSet\Control\Print\Printers\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E979-E325-11CE-BFC1-08002BE10318}\0004]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}\0006]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}\##?#USB#Vid_043d&Pid_0180&MI_01#6&2667223e&0&0001#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ebbb9c&0&90T4099K0398823&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Print Processors\Lexmark S300-S400 Series Print Processor]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_043d&Pid_0180&MI_00]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBPRINT\LexmarkS300-S400_Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR\Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR\Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Control\Print\Printers\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Control\Print\Printers\Lexmark S300-S400 Series]
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Devices]
"Lexmark S300-S400 Series"="winspool,Ne10:"=-
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts]
"Lexmark S300-S400 Series"="winspool,Ne10:,15,45"=-
[-HKEY_USERS\S-1-5-21-2118135359-1856009214-510530097-55447\Software\Microsoft\Windows\ShellNoRoam\MUICache]
[-HKEY_USERS\S-1-5-21-2118135359-1856009214-510530097-55448\Software\Microsoft\Windows\ShellNoRoam\MUICache]
[-HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\Print\Printers\Lexmark S300-S400 Series]
[-HKEY_LOCAL_MACHINE\SOFTWARE\LexmarkInkjet\Lcs\Local\lxea]
[-HKEY_LOCAL_MACHINE\SOFTWARE\LexmarkInkjet\lxea]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ESENT\Process\lxeacoms]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\33E84ED62D5AB9644948A027947BD0DC]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\97C4ECDD3658BE340B79BB1C29AF44F9]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\A614226E33313614298EF83AD8EF07FE]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls]
"C:\WINDOWS\system32\lxeacomm.dll"="1"=-
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls]
"C:\WINDOWS\system32\LXEAinst.dll"="1"=-
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls]
"C:\WINDOWS\system32\lxeaplc.ini"="1"=-
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\S300-S400 Series Port]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\LEGACY_LXEA_DEVICE]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\lxea_device]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Enum\Root\LEGACY_LXEA_DEVICE]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\lxea_device]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\S300-S400 Series Port]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_LXEA_DEVICE]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lxea_device]
[-HKEY_LOCAL_MACHINE\SOFTWARE\LexmarkInkjet]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders]
"C:\Documents and Settings\All Users\Start Menu\Programs\Lexmark\"=-
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TEA_HostCD]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Media Device Manager\Plugins\SP\MSPMSP\KBDeviceList]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Lexmark S300-S400 Series (Copy 1)]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Lexmark S300-S400 Series (Copy 2)]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E979-E325-11CE-BFC1-08002BE10318}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&62d1146&0&90T4099N6701584&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ebbb9c&0&90T4099K0398823&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ffdc3a0&0&90T4099K0405873&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Printers]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\Vid_043d&Pid_0180&MI_00]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBPRINT]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBSTOR\Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\Print\Printers]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Disk\Enum]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\PartMgr\Enum]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\Class\{4D36E979-E325-11CE-BFC1-08002BE10318}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\Class\{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&62d1146&0&90T4099N6701584&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ffdc3a0&0&90T4099K0405873&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Enum\USB\Vid_043d&Pid_0180&MI_00]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Enum\USBPRINT]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Enum\USBSTOR\Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Hardware Profiles\0001\System\CurrentControlSet\Control\Print\Printers]
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Hardware Profiles\0001\System\CurrentControlSet\Control\Print\Printers]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E979-E325-11CE-BFC1-08002BE10318}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&62d1146&0&90T4099N6701584&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ebbb9c&0&90T4099K0398823&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\##?#USBSTOR#Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200#7&ffdc3a0&0&90T4099K0405873&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_043d&Pid_0180&MI_00]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBPRINT]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR\Disk&Ven_Lexmark&Prod_USB_Mass_Storage&Rev__200]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Control\Print\Printers]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PartMgr\Enum]
[-HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\Print\Printers]


ControlSet001/002/003 dont need to be deleted, just FYI...

They have no impact on the current registry....

All that is in CurrentControlSet.

Im guessing ControlSet\DeviceClasses and CCS\Enum and Hardware profiles are the ones that have permissions problems?
Well this is related to the last part of my question, I need to remove all the lexmark entries from registry to whenever I attach any lexmark product, it wouldn't pickup somthing automatically. Please help. I am quite lucky to get rid of printer, but its MFP, unable to get rid of imaging device.
Im trying, but I need to know which ones you get denied on...... Have you tracked that down yet? Might need to use Process Monitor to capture all Access Denied hits when you import the .reg file.....
it is HKLM\system\CurrentControlSet\Enum\Usb\
ASKER CERTIFIED SOLUTION
Avatar of johnb6767
johnb6767
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I was looking for the Batch file to remove Lexmark entries from registry and permission on registry. I got the first portion of the question by my own self and rest I found it here.
Glad we could help...