tazdev Posted February 3, 2005 Share Posted February 3, 2005 Is there a way to change the permissions on a key? I tried to export the key from the registry but the .reg file doesn't note what the security settings are. Basically I want HKEY_LOCAL_MACHINE\blahblahblah\blah to allow Users full control over that part of the registry. I see RegWrite so I know that would be what I would use to write it but does anyone know how to export the settings to a reg file to be imported into the registry? I am looking for something other than actually calling up regedt32 and changing it. I assume I can import the key, then have AutoIT open the regedt32, go to the key, mouse click it then mouse click the Security Menu, then Permissions, then wait for the Dialoge box, click users, click Full Control, Press OK, Close regedt32, logoff. Link to comment Share on other sites More sharing options...
tazdev Posted February 3, 2005 Author Share Posted February 3, 2005 hmm quick google found this:http://www.windowsnetworking.com/kbase/Win...ommandLine.html Link to comment Share on other sites More sharing options...
tazdev Posted February 3, 2005 Author Share Posted February 3, 2005 NM regperm will do it. Run that in AutoIt to account for the switches you need and BAM Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2005 Developers Share Posted February 3, 2005 Is there a way to change the permissions on a key? I tried to export the key from the registry but the .reg file doesn't note what the security settings are. Basically I want HKEY_LOCAL_MACHINE\blahblahblah\blah to allow Users full control over that part of the registry. I see RegWrite so I know that would be what I would use to write it but does anyone know how to export the settings to a reg file to be imported into the registry? I am looking for something other than actually calling up regedt32 and changing it.I assume I can import the key, then have AutoIT open the regedt32, go to the key, mouse click it then mouse click the Security Menu, then Permissions, then wait for the Dialoge box, click users, click Full Control, Press OK, Close regedt32, logoff.<{POST_SNAPBACK}>i am using SetAcl for that.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
tazdev Posted February 3, 2005 Author Share Posted February 3, 2005 (edited) Now $pcname = PCName specified by user regperm.exe is in the C:\i386 I even put in a sleep(100) to make sure it copied over fine first. When I run it I get runwait(@comspec "/c" & "C:\i386\REGPERM.EXE /K HKEY_LOCAL_MACHINE\Software\bbb \\" & $pcname & " /A:Users:F /E") Error: Unable to execute the external program The system cannot find the path specified Now if I open a CMD window and type in the command with the PC's name instead of $pcname the program works with no problem but if in the script it doesn't. edit: It isn't that I don't want to try SetACL. I was given this tool to use first so if I can get it to work then good. If not I will look at SetACL. runwait(@comspec "/c" & "C:\i386\REGPERM.EXE /K HKEY_LOCAL_MACHINE\Software\bbb \\" & $pcname & " /A:Users:F /E") Edited February 3, 2005 by tazdev Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2005 Developers Share Posted February 3, 2005 You are missing spaces around /c... runwait(@comspec " /c C:\i386\REGPERM.EXE /K HKEY_LOCAL_MACHINE\Software\bbb \\" & $pcname & " /A:Users:F /E") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
tazdev Posted February 3, 2005 Author Share Posted February 3, 2005 (edited) You are missing spaces around /c...runwait(@comspec " /c C:\i386\REGPERM.EXE /K HKEY_LOCAL_MACHINE\Software\bbb \\" & $pcname & " /A:Users:F /E")<{POST_SNAPBACK}>Oh my godI am a moron!!!Everyone, join in, HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA Edited February 3, 2005 by tazdev Link to comment Share on other sites More sharing options...
tazdev Posted February 3, 2005 Author Share Posted February 3, 2005 (edited) So with SetACL I would need to put: SetACL.exe -on "hklm\software\bbb" -ot reg -actn ace -ace "n:$pcname\users;p:full" where bbb is the key under software and $pcname is the PCname if I want it to be local not domain? Is it then: edit: RunWait (@comspec " /c " & 'c:\i386\SetACL.exe -on "\\" & $pcname & "hklm\software\bbb" -ot reg -actn ace -ace "n:' & $pcname & '\users;p:full"') ??? The regperm thing didn't work. Dunno why but oh well. Edited February 3, 2005 by tazdev Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2005 Developers Share Posted February 3, 2005 (edited) aren't you are missing a backslash? : "" & $pcname & "\hklm\software\bbb" Edited February 3, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SlimShady Posted February 3, 2005 Share Posted February 3, 2005 This should work. If it doesn't check the documentation from the program. It could be that you need to put 2 backslashes in front of the last $pcname RunWait(@comspec ' /c c:\i386\SetACL.exe -on \\' & $pcname & '\hklm\software\bbb -ot reg -actn ace -ace "n:' & $pcname & '\users;p:full"') Link to comment Share on other sites More sharing options...
tazdev Posted February 3, 2005 Author Share Posted February 3, 2005 Yep that worked. Link to comment Share on other sites More sharing options...
newchel Posted October 4, 2012 Share Posted October 4, 2012 (edited) One more method, using built in Windows utility "RegINI"Manual - http://support.microsoft.com/kb/245031/en-us or use "regini /?" in console.Code of script is very simple:RunWait("regini " & @ScriptDir & "Permissions.txt")Code of Permissions.txt is very simple too:RegistryMachineSOFTWARE1CTradeWare [1 5 7 17] RegistryMachineSOFTWARE1CTradeWareScanOPOS [1 5 7 17]In this case the "RegistryMachineSOFTWARE1CTradeWare" equals HKLMSOFTWARE1CTradeWareAnd numbers in "[]" is the following permissions:1 - Administrators Full Access5 - Creator Full Access7 - World Full Access17 - System Full Access Edited October 4, 2012 by newchel Link to comment Share on other sites More sharing options...
BrewManNH Posted October 4, 2012 Share Posted October 4, 2012 Just an FYI, this thread is over 5 1/2 years old, please don't necropost to something this old. Thanks. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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