Guest TheAncient Posted September 27, 2004 Share Posted September 27, 2004 I am trying to delete a registry key as an administrator but its got permissions that wont allow admin to delete it. Using RegEdit it can not be deleted. Using Regedt32 the permissions can be changed and the key deleted. Is there anyway to script this permissions change within autoit v3? This would save me ohhhh so much time from machine to machine. Link to comment Share on other sites More sharing options...
Josbe Posted September 27, 2004 Share Posted September 27, 2004 See the remarks:RegDelete AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Guest TheAncient Posted September 27, 2004 Share Posted September 27, 2004 Thank you for the reply, however this does not answer my question. The registry entries I want to delete have permissions that dont allow Administrator to delete them. However the Administrator does have the rights to change the rights on the key so that it can be deleted. From Regedt32 you can change the permissions on the key and then its deletable. I want to automate this change in permissions so that I can use RegDelete. From doing some googling I see that the command regini.exe may allow me to script it, but I will have to include regini.exe along with my AutoIt script. This is doable but not optimal. See the remarks: RegDelete <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
JSThePatriot Posted September 27, 2004 Share Posted September 27, 2004 Optimal all depends on if regini.exe has to install dlls or if it is a stand alone program. I am taking it you will be running Regedt32 from the run command line? If that is the case... Send("#r") WinWaitActive("Run") Send("Regedt32{Enter}") Now you have that open. Next you need to do some detective work with AutoIt's very own WindowSpy. Check the control names of the buttons you need to click and start scripting. I would recommend you come back with some code... let us know how it isnt performing right and we will try to fix it for you. I do believe the help file contains much useful information on how to manipulate a program while you have it open. 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...
Josbe Posted September 27, 2004 Share Posted September 27, 2004 If that is the case... Send("#r") WinWaitActive("Run") Send("Regedt32{Enter}") Now you have that open. Next you need to do some detective work with AutoIt's very own WindowSpy. Check the control names of the buttons you need to click and start scripting. I would recommend you come back with some code... let us know how it isnt performing right and we will try to fix it for you. I do believe the help file contains much useful information on how to manipulate a program while you have it open. JS <{POST_SNAPBACK}>Yeah, "this is doable but not optimal." I think that, "RegIni.exe" it's better method between both cases. The registry entries I want to delete have permissions that dont allow Administrator to delete them....it seems like a limitation... AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
emmanuel Posted September 27, 2004 Share Posted September 27, 2004 Send("#r") WinWaitActive("Run") Send("Regedt32{Enter}") <{POST_SNAPBACK}>Just have to say, this is the worst way to run a program. This is what Run() is for. "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
JSThePatriot Posted September 27, 2004 Share Posted September 27, 2004 Hrm... true but that requires knowing where the file is :-P 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...
Guest TheAncient Posted September 27, 2004 Share Posted September 27, 2004 Ok, for now I am calling this program to recursively change the permissions on the keys I want to delete. Works great so far. Its opensource too! http://setacl.sourceforge.net Link to comment Share on other sites More sharing options...
Valik Posted September 27, 2004 Share Posted September 27, 2004 Hrm... true but that requires knowing where the file is :-P JS <{POST_SNAPBACK}>And you think that using the Run Dialog doesn't? Both of them look in the same environment variable (PATH) to locate applications. If you can use the Run Dialog to run it, then you can use Run() to run it equally as well. Link to comment Share on other sites More sharing options...
JSThePatriot Posted September 27, 2004 Share Posted September 27, 2004 (edited) And you think that using the Run Dialog doesn't? Both of them look in the same environment variable (PATH) to locate applications. If you can use the Run Dialog to run it, then you can use Run() to run it equally as well. <{POST_SNAPBACK}>Okay okay hehe. JS Edit: Since we are on the Run() subject... can I get a bit of help? This is my code... $url = "http://www.familychristianacademy.com/admin" Run(@ComSpec & " /c start " & $url,'',@SW_MAXIMIZE) The window doesnt maximize... JS Edited September 27, 2004 by JSThePatriot 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...
Josbe Posted September 27, 2004 Share Posted September 27, 2004 Ok, for now I am calling this program to recursively change the permissions on the keys I want to delete. Works great so far. Its opensource too! http://setacl.sourceforge.net <{POST_SNAPBACK}>Fine. (thxs 4 the info) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
emmanuel Posted September 27, 2004 Share Posted September 27, 2004 Okay okay hehe. JS Edit: Since we are on the Run() subject... can I get a bit of help? This is my code... $url = "http://www.familychristianacademy.com/admin" Run(@ComSpec & " /c start " & $url,'',@SW_MAXIMIZE) The window doesnt maximize... JS <{POST_SNAPBACK}>That's 'cause you're telling the command window to maximize, not start... go to the command prompt, and type start /? that will give you command line options for your OS and the start command.... btw, here's how I did it for access: $ACCESSPATH = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "") run('"' & $accesspath & '" "' & $myDB & '"') "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Valik Posted September 28, 2004 Share Posted September 28, 2004 (edited) See sugi's post below, his has correct information. Edited September 28, 2004 by Valik Link to comment Share on other sites More sharing options...
Holger Posted September 28, 2004 Share Posted September 28, 2004 Maybe you could also use "RegPerm" before:http://homepages.cae.wisc.edu/~micro/regperm/ Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
sugi Posted September 28, 2004 Share Posted September 28, 2004 You can run anything without issue with the exception of things located in: Or whatever the equivalent to that directory is. For some reason, the run dialog looks there, too, even though its not defined on the path anywhere. <{POST_SNAPBACK}>That's simply wrong. The Run dialog does NOT check the directory you mentioned. It checks the registry. The Run Dialog does exactly the same as cmd /c start ... which means: 1. check current directory 2. check %PATH% 3. check if windows already knows where to find the app (registry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths) 4. check if it's a protocoll (means: begins like http://, ftp://, hcp://, ...) and passes it to the correct file protocol handler 5. check if it's a document and then runs the correct program that's associated with the document type. The Run() function only does the first two checks. This is why Run() cannot open programs that are not within the path or current directory and is unable to handle protocols and documents. Link to comment Share on other sites More sharing options...
Guest TheAncient Posted September 28, 2004 Share Posted September 28, 2004 Nice, thank you. That looks like another good program to use. Though I dont see any licensing info. SetACL works on files and has other functions too, so for now I think I will stick with that. And its GPL so I know I can distribute it without issue. Maybe you could also use "RegPerm" before: http://homepages.cae.wisc.edu/~micro/regperm/ <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
JSThePatriot Posted September 28, 2004 Share Posted September 28, 2004 That's 'cause you're telling the command window to maximize, not start...go to the command prompt, and type start /? that will give you command line options for your OS and the start command....btw, here's how I did it for access:$ACCESSPATH = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "") run('"' & $accesspath & '" "' & $myDB & '"')<{POST_SNAPBACK}>Thanks for that tip I didnt even think about that.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...
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