Iznogoud Posted June 9, 2006 Share Posted June 9, 2006 (edited) In a earlier topic http://www.autoitscript.com/forum/index.ph...topic=27147&hl= i have asked how to enable some programs in Add/Remove Programs.The solution was ControlCommand, But.....This doesn't work in the group policy editor. If you wanna know what a Group policiy editor is you can go to your Start > Run > type "gpedit.msc". On Xp and 2003 it will open a group policy editor where you can set some restriction for the user or computer where you are enabling it.So be carefull, if you don't know what your dealing with then don't adjust the settings and leave them. Just put them back to NON-configured as it is in default. Then nothing happens.Back to my story.... If i use ControlCommand in the group policy editor it doesn't work. Am i doing something wrong? or is there an other command wich could be more usefull for me?I know you download group policy management console and export and import it, but this works only on the same machine. Edited June 9, 2006 by Iznogoud Link to comment Share on other sites More sharing options...
Iznogoud Posted June 9, 2006 Author Share Posted June 9, 2006 No solution? Is the only possibily then with 4 times arrow down then press enter then press tab etc etc.? Link to comment Share on other sites More sharing options...
emendelson Posted June 10, 2006 Share Posted June 10, 2006 (edited) No solution? Is the only possibily then with 4 times arrow down then press enter then press tab etc etc.? Look into NTrights.exe, which is well-documented on the web, and comes with XP Pro. I use it in a script to change user rights, and I *think* it works for group policies also. You may need to prompt the user for the Windows password and then plug the password into the command (at least that's what my script needs to do). Edited June 10, 2006 by Edward Mendelson Link to comment Share on other sites More sharing options...
Iznogoud Posted June 10, 2006 Author Share Posted June 10, 2006 Look into NTrights.exe, which is well-documented on the web, and comes with XP Pro. I use it in a script to change user rights, and I *think* it works for group policies also. You may need to prompt the user for the Windows password and then plug the password into the command (at least that's what my script needs to do).nope thats not a option, you can do alot of things with that program but not setting group policies. Link to comment Share on other sites More sharing options...
Iznogoud Posted June 12, 2006 Author Share Posted June 12, 2006 Still didn't find a solution. I have made a screenshot maybe that will help:How can i control this in a good way and not by using mouseclick at coordinates. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 12, 2006 Moderators Share Posted June 12, 2006 Have you seen this thread in the Developers forum yet?http://www.autoitscript.com/forum/index.php?showtopic=9988 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Iznogoud Posted June 12, 2006 Author Share Posted June 12, 2006 Have you seen this thread in the Developers forum yet?http://www.autoitscript.com/forum/index.php?showtopic=9988Not untill now Only problem is that i can understand now the basics of AutoIT with some area better then other. But this code in that thread Ok the first part is C i think, but when it comes to AutoIT with the files of Tweast its become some what easier. I will try this, hopefully i can get it to work. Link to comment Share on other sites More sharing options...
Iznogoud Posted June 13, 2006 Author Share Posted June 13, 2006 I have a problem with selecting the listview items. I posted also a question at the developers area, so dont know if i need to post it here too.----------------------------------------------------------------------------------------------------------------The select tree does work fine, but how can i select things in a listview?I am trying to make a script wich enables alot of policy settings.I described my situatie at: http://www.autoitscript.com/forum/index.ph...topic=27426&hl=Is there a way to do this?---------------------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Zedna Posted June 13, 2006 Share Posted June 13, 2006 (edited) Still didn't find a solution. I have made a screenshot maybe that will help:How can i control this in a good way and not by using mouseclick at coordinates.Instead of ControlCommand use ControlListView, that's all Edited June 13, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Iznogoud Posted June 13, 2006 Author Share Posted June 13, 2006 Instead of ControlCommand use ControlListView, that's all that simple? , i will try it right away :"> Link to comment Share on other sites More sharing options...
JSThePatriot Posted June 13, 2006 Share Posted June 13, 2006 that simple? , i will try it right away :">If you would please let me know once you get this all worked out. I also need to manipulate the group policy, not to mention create a user and set up some options for him.It would just make my job easier if I didnt have to manually set the same settings 35 times throughout our network.Thanks,JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Iznogoud Posted June 13, 2006 Author Share Posted June 13, 2006 If you would please let me know once you get this all worked out. I also need to manipulate the group policy, not to mention create a user and set up some options for him.It would just make my job easier if I didnt have to manually set the same settings 35 times throughout our network.Thanks,JSI will, but if i look at your post count you have more skill then i do, unless you only reply rubbish But eej, i will help for as far i can. Link to comment Share on other sites More sharing options...
Iznogoud Posted June 13, 2006 Author Share Posted June 13, 2006 (edited) Why doesn't this work? WinWait ( "Group Policy Object Editor" ) WinActivate ( "Group Policy Object Editor" ) WinWaitActive ( "Group Policy Object Editor" ) ControlListView ( "Group Policy Object Editor", "", "SysListView321", "Select", 'Remove Documents menu from Start Menu' ) ;Send("{ENTER}") I just used the basics wich was a working script with ControlCommand. I adjusted the values with help from the Help file. But still doesn't work -edit- WinWait ( "Group Policy Object Editor" ) WinActivate ( "Group Policy Object Editor" ) WinWaitActive ( "Group Policy Object Editor" ) ControlListView ( "Group Policy Object Editor", "", "SysListView321", "Select", 3 'Remove Documents menu from Start Menu' ) ;Send("{ENTER}") After select if i put there numbers from 0 to a maximum of the listview it does get selected. How can i let it select by name and not count the lines and give them numbers? Edited June 13, 2006 by Iznogoud Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 13, 2006 Moderators Share Posted June 13, 2006 My title is different than yours $Title = "Group Policy" $Item = ControlListView($Title, '', 'SysListView321', 'FindItem', 'Remove Documents menu from Start Menu') ControlListView($Title, '', 'SysListView321', 'Select', $Item) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
seandisanti Posted June 13, 2006 Share Posted June 13, 2006 you can manipulate policy settings in the registry also... i have a book somewhere that lists the registry keys created/modified for each of the options in group policy. i'm sure you can find a reference on the web, or even just muddle through it (assuming you're comfortable playing in the registry and accept the associated risk)... i am pretty sure the machine policies were in.... HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies you can also find more policy settings in the user sections of the registry... Link to comment Share on other sites More sharing options...
Iznogoud Posted June 13, 2006 Author Share Posted June 13, 2006 (edited) My title is different than yours $Title = "Group Policy" $Item = ControlListView($Title, '', 'SysListView321', 'FindItem', 'Remove Documents menu from Start Menu') ControlListView($Title, '', 'SysListView321', 'Select', $Item) Indeed, ok your code is better with the variables. Thats one thing i much learn to use more variables instead of typing the same all over again. And your script is doing is job almost perfect The select command is not selecting the item but it puts it in a brown area and not blue wich is normal if you select it. How can i really select it so i can send a key like {ENTER} to get the properties of it to enable the option? you can manipulate policy settings in the registry also... i have a book somewhere that lists the registry keys created/modified for each of the options in group policy. i'm sure you can find a reference on the web, or even just muddle through it (assuming you're comfortable playing in the registry and accept the associated risk)... i am pretty sure the machine policies were in.... HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies you can also find more policy settings in the user sections of the registry... The policies are the same for windows 2000/xp/2003 even some for Windows 98 and the registry is not. And you won't want to adjust the registry of each pc to activate these restrictions. You want to manage them in one place. But i nice and good alternative way, but if i see what AutoIT can do espicially in the hand like the top posters on this forum for an example Smoke_N, the options are almost unlimited. So this must work also in some way -edit- I have done it like this now, but i know or there must be a better way: $Title = "Group Policy" WinWait($Title) WinActivate($Title) WinWaitActive($Title) $Item = ControlListView($Title, '', 'SysListView321', 'FindItem', 'Remote programs on Settings menu') ControlListView($Title, '', 'SysListView321', 'Select', $Item) Send("{TAB}") Send("{ENTER}") Sleep(2000) Send("{ENTER}") $Item = ControlListView($Title, '', 'SysListView321', 'FindItem', 'Remote My Network Places icon from Start Menu') ControlListView($Title, '', 'SysListView321', 'Select', $Item) Send("{TAB}") Send("{ENTER}") Sleep(2000) Send("{ENTER}") For an example, i just open the properties and do a 2 sec sleep instead of activating. Don't wanna change settings automatic untill i know for sure it does work Edited June 13, 2006 by Iznogoud Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 13, 2006 Moderators Share Posted June 13, 2006 Local $Title = "Group Policy" Local $TextToFind = 'Remove Documents menu from Start Menu' Local $ClassName = 'SysListView321' Local $Item = ControlListView($Title, '', $ClassName, 'FindItem', $TextToFind) ControlListView($Title, '', $ClassName, 'Select', $Item) ControlSend($Title, '', $ClassName, '{ENTER}') Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
seandisanti Posted June 13, 2006 Share Posted June 13, 2006 Indeed, ok your code is better with the variables. Thats one thing i much learn to use more variables instead of typing the same all over again. And your script is doing is job almost perfect The select command is not selecting the item but it puts it in a brown area and not blue wich is normal if you select it. How can i really select it so i can send a key like {ENTER} to get the properties of it to enable the option?The policies are the same for windows 2000/xp/2003 even some for Windows 98 and the registry is not. And you won't want to adjust the registry of each pc to activate these restrictions. You want to manage them in one place. But i nice and good alternative way, but if i see what AutoIT can do espicially in the hand like the top posters on this forum for an example Smoke_N, the options are almost unlimited. So this must work also in some way smoke definitely knows his stuff, that's for sure... i'm pretty sure i've used the same registry locations to set policy on 98,xp, and 2k. the only thing that i've run into that could be considered a snag was that older versions of windows had fewer options. i wouldn't suggest completely managing group policy by registry unless there was really no other way, but it helped me out at my last company when we had i had to modify group policy as a non administrator. Link to comment Share on other sites More sharing options...
Iznogoud Posted June 13, 2006 Author Share Posted June 13, 2006 (edited) Local $Title = "Group Policy" Local $TextToFind = 'Remove Documents menu from Start Menu' Local $ClassName = 'SysListView321' Local $Item = ControlListView($Title, '', $ClassName, 'FindItem', $TextToFind) ControlListView($Title, '', $ClassName, 'Select', $Item) ControlSend($Title, '', $ClassName, '{ENTER}') You are the man You can go to sleep with a good feeling This works great, and even better then my worse code. So if i want to adjust more then one i can simple use these lines to adjust the TextToFind? Local $TextToFind = 'Remove Documents menu from Start Menu' Local $Item = ControlListView($Title, '', $ClassName, 'FindItem', $TextToFind) ControlListView($Title, '', $ClassName, 'Select', $Item) ControlSend($Title, '', $ClassName, '{ENTER}') And just change the value 'Remove Documents menu from Start Menu' in the next value wich must be selected? smoke definitely knows his stuff, that's for sure... i'm pretty sure i've used the same registry locations to set policy on 98,xp, and 2k. the only thing that i've run into that could be considered a snag was that older versions of windows had fewer options. i wouldn't suggest completely managing group policy by registry unless there was really no other way, but it helped me out at my last company when we had i had to modify group policy as a non administrator. True, in case of no other solution the registry is a good way to restrict and adjust settings. Everything is possible, but policy are just a bit easier then registry settings, in case of manage and deploying. Edited June 13, 2006 by Iznogoud Link to comment Share on other sites More sharing options...
Zedna Posted June 13, 2006 Share Posted June 13, 2006 So if i want to adjust more then one i can simple use these lines to adjust the TextToFind? Just use it in Function: Func OpenItem($TextToFind) Local $Title = "Group Policy" Local $Item = ControlListView($Title, '', 'SysListView321', 'FindItem', $TextToFind) ControlListView($Title, '', 'SysListView321', 'Select', $Item) ControlSend($Title, '', 'SysListView321', '{ENTER}') EndFunc OpenItem('Remove Documents menu from Start Menu') OpenItem('Remote programs on Settings menu') OpenItem('Remote My Network Places icon from Start Menu') Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
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