Compare cert salaries and plan your next career move
joey74055 wrote: » Well to create the registry file you just need to open up the registry, make your edit then go to File, Export, name it and save it. After this you could just put it out on everyones desktop and have them double-click the file and and click on Yes. This will overwrite their registry with the new one. Always use caution with this first before you do it and test it on a test machine.
94jedi wrote: » thanks. problem is I need to delete that entire "printserver02" folder as well as the keys in it and apparently, a .reg file can't actually delete things, only add them.
set objNetwork = CreateObject("wscript.network") Set objPrinters = objNetwork.EnumPrinterConnections For i = 0 to objPrinters.Count - 1 Step 2 PrinterPath = objPrinters.Item(i+1) if Instr(lcase(PrinterPath), "printserver02") > 0 then objNetwork.RemovePrinterConnection PrinterPath, true, true end if Next
Megadeth4168 wrote: » What about VBS script... maybe something like....set objNetwork = CreateObject("wscript.network") Set objPrinters = objNetwork.EnumPrinterConnections For i = 0 to objPrinters.Count - 1 Step 2 PrinterPath = objPrinters.Item(i+1) if Instr(lcase(PrinterPath), "printserver02") > 0 then objNetwork.RemovePrinterConnection PrinterPath, true, true end if Next
\registry\machine\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\printserver02 [DELETE]
dynamik wrote: » Create a file called delprint.txt Paste this into that: \registry\machine\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\printserver02 [DELETE] Run regini delprint.txt
Claymoore wrote: » Once you get the regini script working, your next challenge will be deployment. You can write a wrapper script around the regini command (a batch file would be fine) and make sure everyone has access to the delprinter.txt file. You could then deploy the script via login script or a startup script in group policy. If you run this in the context of a standard user, it will probably fail since they likely do not have the rights to delete keys in the HKEY_Local_Machine hive. You can use the security settings in group policy to grant everyone the delete right to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers key so the script will run successfully.
Compare salaries for top cybersecurity certifications. Free download for TechExams community.