Bert Posted September 29, 2007 Posted September 29, 2007 Here is my question, and I hope someone with wisdom can answer this: You have a windows print server. There are 200 printers installed on the server They are all shared To be able to print, you can do one of 2 methods: 1. Logged on as the user: Start>Run>\\printserver\printer1 This will connect to the share on a PROFILE level. In other words, if someone else logs in, they will not be connected to the printer. It doesn't even show up in the list of printers. Only the user who did this will be connected, and see the printer listed in the printers folder. 2. Use command line like this: RunWait("rundll32 printui.dll,PrintUIEntry /in /q /n" & $ret) This installs the printer on a MACHINE level. In other words, no matter who logs in, you get connected to the share. My question is this: If you are logged on as a admin, how do you delete any printer shares that the user is connected to on a PROFILE level? I want to make a tool that does this. I currently have a tool that will detect any printers installed, but only under the user name I'm currently logged on as. I suspect (though have no idea how) the registry is involved. Thoughts? The Vollatran project My blog: http://www.vollysinterestingshit.com/
PsaltyDS Posted September 29, 2007 Posted September 29, 2007 I think you would have to open that user's NTUSER.DAT, which is their HKCU (HKEY_CURRENT_USER) hive when they are logged in, and change it there. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Bert Posted September 30, 2007 Author Posted September 30, 2007 Thats the problem. If they are not logged in, how do I get it? I need to be able to delete the connection to the share so that when they log in again, the printers are mapped where I need them to be. I can't do anything with login scripts. I'm not allowed. The Vollatran project My blog: http://www.vollysinterestingshit.com/
PsaltyDS Posted September 30, 2007 Posted September 30, 2007 Thats the problem. If they are not logged in, how do I get it? I need to be able to delete the connection to the share so that when they log in again, the printers are mapped where I need them to be. I can't do anything with login scripts. I'm not allowed.Well, from AutoIt, I'm not sure you can. In RegEdt32.exe you can load the hive (the user's NTUser.DAT file), edit, and then unload the hive. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
JBeef Posted September 30, 2007 Posted September 30, 2007 oops - again a missing Larry post -http://www.autoitscript.com/forum/index.ph...st&p=382209RegLoadHive here - ~Jap
PsaltyDS Posted September 30, 2007 Posted September 30, 2007 oops - again a missing Larry post -http://www.autoitscript.com/forum/index.ph...st&p=382209RegLoadHive here - ~JapOoh... good link. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now