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

collage_jeanz
collage_jeanz used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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

Author

Commented:
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.
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Most Valuable Expert 2011
Top Expert 2011

Commented:
"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?
Most Valuable Expert 2011
Top Expert 2011

Commented:
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?
 

Author

Commented:
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.
Most Valuable Expert 2011
Top Expert 2011

Commented:
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....

Author

Commented:
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]


Most Valuable Expert 2011
Top Expert 2011

Commented:
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?

Author

Commented:
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.
Most Valuable Expert 2011
Top Expert 2011

Commented:
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.....

Author

Commented:
it is HKLM\system\CurrentControlSet\Enum\Usb\
Most Valuable Expert 2011
Top Expert 2011
Commented:
Before you run your script, use Subinacl to modify that key.....

subinacl /subkeyreg "HKLM\system\CurrentControlSet\Enum\Usb" /grant=Domain\%username%

or

subinacl /subkeyreg "HKLM\system\CurrentControlSet\Enum\Usb" /grant=Users

SubInACL (SubInACL.exe)
http://www.microsoft.com/downloads/en/details.aspx?familyid=e8ba3e56-d8fe-4a91-93cf-ed6985e3927b&displaylang=en

Once you install it on a machine, you can have a simple batch script to copy it to the target system, run the command above, and then import the .reg file.

Test the command on a single machine, and then import the .reg file, and lets see if it imports ok.... Then we can script it....

Author

Commented:
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.
Most Valuable Expert 2011
Top Expert 2011

Commented:
Glad we could help...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial