+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
Scripts Thread, Deleting reg Keys - getting user Sid in Coding and Web Development; Originally Posted by mac_shinobi sorry was in a bit of a rush - also there is the stdout line - ...
  1. #16

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,713
    Thank Post
    269
    Thanked 1,115 Times in 1,011 Posts
    Rep Power
    345
    Quote Originally Posted by mac_shinobi View Post
    sorry was in a bit of a rush - also there is the stdout line - I think ( not sure ) but you may be able to remove that as well.


    Set StdOut = WScript.StdOut
    Don't worry you have done me a massive favour!!

  2. Thanks to glennda from:

    mac_shinobi (18th July 2012)

  3. #17

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,213
    Thank Post
    2,766
    Thanked 935 Times in 875 Posts
    Rep Power
    343
    Quote Originally Posted by glennda View Post
    Don't worry you have done me a massive favour!!
    Anytime, As per @sted mentioned, just curious if there is a more official and better method of doing this. I know you can use the rundll32 printui.dll command to delete / remove printers, not sure in regards to GPO / GPP etc as far as it removing printers ??

    edit - @Steve21 is a lot better than myself at coding, think I've managed to leave illegal operators etc in previous code so still got a learning curve.
    Last edited by mac_shinobi; 18th July 2012 at 08:40 PM.

  4. #18

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,713
    Thank Post
    269
    Thanked 1,115 Times in 1,011 Posts
    Rep Power
    345
    Quote Originally Posted by mac_shinobi View Post
    Anytime, As per @sted mentioned, just curious if there is a more official and better method of doing this. I know you can use the rundll32 printui.dll command to delete / remove printers, not sure in regards to GPO / GPP etc as far as it removing printers ??

    edit - @Steve21 is a lot better than myself at coding, think I've managed to leave illegal operators etc in previous code so still got a learning curve.
    I tried the rundll32 printui and it wouldn't delete the printers nor would the gui hence why i had to dig further and further!

  5. Thanks to glennda from:

    mac_shinobi (18th July 2012)

  6. #19

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,654
    Thank Post
    324
    Thanked 506 Times in 474 Posts
    Rep Power
    177
    Quote Originally Posted by mac_shinobi View Post
    edit - @Steve21 is a lot better than myself at coding, think I've managed to leave illegal operators etc in previous code so still got a learning curve.

    Pfft You do good. Was only because of the whole HTA bit that it wasn't working!

    Steve

  7. Thanks to Steve21 from:

    mac_shinobi (18th July 2012)

  8. #20

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,213
    Thank Post
    2,766
    Thanked 935 Times in 875 Posts
    Rep Power
    343
    Still never managed to get the HTA working as I wanted - I still liked the way you formatted the html and combined that with WMI querries etc lol.

  9. #21

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,213
    Thank Post
    2,766
    Thanked 935 Times in 875 Posts
    Rep Power
    343
    There isn't any other keys that need deleting from HKCU or the likes as a comment above states that something else points to the HKU keys ?

  10. #22

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,713
    Thank Post
    269
    Thanked 1,115 Times in 1,011 Posts
    Rep Power
    345
    Quote Originally Posted by mac_shinobi View Post
    There isn't any other keys that need deleting from HKCU or the likes as a comment above states that something else points to the HKU keys ?
    Not from what I can see and have read elsewhere - essentially after an old server was decommissioned the printers where lingering on the client machines (although they should have previously been removed). But windows tends to get funny when you try to delete printers on a machine which don't exist any more.

  11. Thanks to glennda from:

    mac_shinobi (18th July 2012)

  12. #23

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,213
    Thank Post
    2,766
    Thanked 935 Times in 875 Posts
    Rep Power
    343
    Just as an update ( may or may not find this helpful / handy etc ) but found this link :

    Remove Printer Definition from the Registry

    There is a problem with NT printer definitions that may cause you problems. You follow standard advice to uninstall and reinstall the printer driver. Sometimes this doesn't fix the problem and you have no choice but to remove a printer. When you use the Remove or Delete Printer options in Print Manager, the printer connection disappears immediately. However, the spooler simply marks the printer for deletion. NT doesn't actually delete the printer until you reboot the system. Sometimes NT will delete the definition if you stop and restart the spooler. Sometimes it doesn't. If this doesn't work, and you will find out when you try to redefine the printer. No issue for workstations. You can reboot. Unfortunately there are servers which can not be rebooted (or at least not for something like a printer definition). For servers which can not be rebooted, you can remove the printer definition from the registry by hand prior to the reinstall. If it is a local printer (My Computer), go to the following registry keys and delete the respective entries:


    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Environments\ Windows NT x86\ Drivers\Version-2\


    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Printers\


    If it is a network printer (network printer server or \\), go to the following registry keys and delete the respective and entries:


    HKEY_CURRENT_USER\Printers\Connections\


    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Providers\ LanMan Print Services\Servers\\Printers\


    After the registry edit, you need to stop and restart the spooler service. At this point, you'll be able to reinstall the printer driver correctly.


SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. logoff script to delete registry key
    By ICMC in forum Scripts
    Replies: 3
    Last Post: 26th January 2009, 10:37 PM
  2. CC3, 2Type and Reg Keys
    By CHR1S in forum Network and Classroom Management
    Replies: 2
    Last Post: 25th April 2008, 04:06 PM
  3. Replies: 2
    Last Post: 28th November 2007, 04:40 PM
  4. Mandatory profile gets deleted along with the user account
    By mark_sharman in forum Network and Classroom Management
    Replies: 2
    Last Post: 23rd February 2007, 09:38 PM
  5. script to change permissions on Reg Key
    By e_g_r in forum Windows
    Replies: 4
    Last Post: 16th February 2007, 05:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •