 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
DeWild1
Joined: 30 Apr 2006 Posts: 358 Location: Shigle Springs
|
Posted: Mon Mar 08, 2010 6:35 pm Post subject: 64 bit regdel. You need to know C++ to help me. |
|
|
I tried to modify the regwrite from http://www.autohotkey.com/forum/viewtopic.php?t=39560 to make a reg delete but I am WAY to stupid!
Taken from MSDN, http://msdn.microsoft.com/en-us/library/ms724847%28VS.85%29.aspx
| Quote: | RegDeleteKeyEx Function
Deletes a subkey and its values from the specified platform-specific view of the registry. Note that key names are not case sensitive.
To delete a subkey as a transacted operation, call the RegDeleteKeyTransacted function.
Syntax
C++
LONG WINAPI RegDeleteKeyEx(
__in HKEY hKey,
__in LPCTSTR lpSubKey,
__in REGSAM samDesired,
__reserved DWORD Reserved
);
|
My foolish try, (Its an added function from http://www.autohotkey.com/forum/viewtopic.php?t=39560 and I tried to change things around to see if it works. It may be best to ignore this foolishness and strart fresh with your own function.)
| Code: |
RegDel64(sRootKey, sKeyName, sValueName = "", sValue = "") {
HKEY_CLASSES_ROOT := 0x80000000 ; http://msdn.microsoft.com/en-us/library/aa393286.aspx
HKEY_CURRENT_USER := 0x80000001
HKEY_LOCAL_MACHINE := 0x80000002
HKEY_USERS := 0x80000003
HKEY_CURRENT_CONFIG := 0x80000005
HKEY_DYN_DATA := 0x80000006
HKCR := HKEY_CLASSES_ROOT
HKCU := HKEY_CURRENT_USER
HKLM := HKEY_LOCAL_MACHINE
HKU := HKEY_USERS
HKCC := HKEY_CURRENT_CONFIG
REG_NONE := 0 ; http://msdn.microsoft.com/en-us/library/ms724884.aspx
REG_SZ := 1
REG_EXPAND_SZ := 2
REG_BINARY := 3
REG_DWORD := 4
REG_DWORD_BIG_ENDIAN := 5
REG_LINK := 6
REG_MULTI_SZ := 7
REG_RESOURCE_LIST := 8
KEY_QUERY_VALUE := 0x0001 ; http://msdn.microsoft.com/en-us/library/ms724878.aspx
KEY_WOW64_64KEY := 0x0100 ; http://msdn.microsoft.com/en-gb/library/aa384129.aspx (do not redirect to Wow6432Node on 64-bit machines)
KEY_SET_VALUE := 0x0002
KEY_WRITE := 0x20006
myhKey := %sRootKey% ; pick out value (0x8000000x) from list of HKEY_xx vars
;myValueType := %sValueType% ; pick out value (0-8) from list of REG_SZ,REG_DWORD etc. types
IfEqual,myhKey,, { ; Error - Invalid root key
ErrorLevel := 3
return ErrorLevel
}
RegAccessRight := KEY_QUERY_VALUE + KEY_WOW64_64KEY + KEY_ALL_ACCESS
DllCall("Advapi32.dll\RegDeleteKeyEx", "uint", myhKey, "str", sKeyName, "uint", 0, "uint", 0, "uint", 0, "uint", RegAccessRight, "uint", 0, "uint*", hKey) ; open/create key
If (myValueType == REG_SZ or myValueType == REG_EXPAND_SZ) {
vValueSize := StrLen(sValue) + 1
DllCall("Advapi32.dll\RegDeleteKeyEx", "uint", hKey, "str", sValueName, "uint", 0, "uint", 0, "str", sValue, "uint", vValueSize) ; write string
} Else If (myValueType == REG_DWORD) {
vValueSize := 4
DllCall("Advapi32.dll\RegDeleteKeyEx", "uint", hKey, "str", sValueName, "uint", 0, "uint", 0, "uint*", sValue, "uint", vValueSize) ; write dword
} Else { ; REG_MULTI_SZ, REG_BINARY, or other unsupported value type
ErrorLevel := 2
}
DllCall("Advapi32.dll\RegCloseKey", "uint", hKey)
return ErrorLevel
} |
basically I added, KEY_ALL_ACCESS to RegAccessRight and tried to delete extra things that the regwrite has becasue regdelete does not need the " myValueType := %sValueType% ; pick out value (0- from list of REG_SZ,REG_DWORD etc. types " Again, you should ignore this and start fresh, I am just trying to prove I tried before I asked for help.
Also, if someone is able to understand this stuff, I would KILL or DIE to have a way of manipulating the security and owner stuff in the registry through AHK!
Seriously, I have was not broke, I would pay $1000 for this help!
http://msdn.microsoft.com/en-us/library/aa379314%28VS.85%29.aspx
When all is said and done, for everyone, not just me, I think the best functions would be.
RegWrite64()
RegRead64()
RegDelete64()
SetOwner()
SetPermissions()
With Windows 7 mainly being 64bit, more and more people will need this.
RegWrite64() and RegRead64() work great but others may need delete too. Setting Owner and Permissions will be a usefull tool for me and others.
I have spent days trying to understand this stuff and port it into AHK.
If you want something in exchange for your time to make these functions, name it. We can fix computers better than anyone I know of and we guarantee it for a year. So if you got a brother or annoying sister who keeps getting infected, PM me and I will take care of them for you. _________________ CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
Posted: Mon Mar 08, 2010 6:58 pm Post subject: |
|
|
So what do you get calling the dll function itself
| Code: | hkey:=HKEY_CURRENT_USER := 0x80000001
lpSubKey= ;Enter subkey here
MsgBox % DllCall("advapi32\RegDeleteKeyEx","UInt",hKey,"Str",lpSubKey,"UInt",0x0200,"UInt",0)
MsgBox % ErrorLevel "/" A_LastError |
_________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun  |
|
| Back to top |
|
 |
DeWild1
Joined: 30 Apr 2006 Posts: 358 Location: Shigle Springs
|
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 08, 2010 10:47 pm Post subject: Re: 64 bit regdel. You need to know C++ to help me. |
|
|
| DeWild1 wrote: | | ...I would pay $1000 for this help! |
...if you're serious, I'll get started testing right away...but someone else may beat me to it...I have to say I can only write it & test it on WinXP, but if the 1st version don't work on WinVista or Win7, I'll keep debugging (with your testing/help) until it does work...
I would LOVE to make $1000 writing AutoHotkey!
| DeWild1 wrote: | SetOwner()
SetPermissions() |
...if those functions don't exist in the WinAPI, then I'd need examples of the params you want them to accept...(& maybe a pointer to the WinAPI you want me to wrap them onto {if not the one already linked})...
Note: AutoHotkey's Server's Clock is 1min fast |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 08, 2010 11:19 pm Post subject: Re: 64 bit regdel. You need to know C++ to help me. |
|
|
| Code: | | RegAccessRight := KEY_QUERY_VALUE + KEY_WOW64_64KEY + KEY_ALL_ACCESS |
...sometimes it don't matter, but that should be...
| Code: | | RegAccessRight:=KEY_QUERY_VALUE|KEY_WOW64_64KEY|KEY_ALL_ACCESS |
...you should "or" | bit values together...again I said sometimes "plus"ing + them is the same as "or"ing them, but generally you should always "or" them anyway...
| Code: | | DllCall("Advapi32.dll\RegDeleteKeyEx", "uint", myhKey, "str", sKeyName, "uint", 0, "uint", 0, "uint", 0, "uint", RegAccessRight, "uint", 0, "uint*", hKey) ; open/create key |
...will not (or doesn't appear that it should) "open/create key"...that should probably be either RegOpenKey or RegOpenKeyEx & needs different params...
Unfortunately, I can't directly test RegDeleteKeyEx cuz it's Vista+ only...I could however test with RegDeleteKey & "guess" what'll work on Vista+... |
|
| Back to top |
|
 |
DeWild1
Joined: 30 Apr 2006 Posts: 358 Location: Shigle Springs
|
Posted: Tue Mar 09, 2010 3:12 am Post subject: Re: 64 bit regdel. You need to know C++ to help me. |
|
|
| Anonymous wrote: | | DeWild1 wrote: | | ...I would pay $1000 for this help! |
...if you're serious, I'll get started testing right away...but someone else may beat me to it...I have to say I can only write it & test it on WinXP, but if the 1st version don't work on WinVista or Win7, I'll keep debugging (with your testing/help) until it does work...
I would LOVE to make $1000 writing AutoHotkey!
| DeWild1 wrote: | SetOwner()
SetPermissions() |
...if those functions don't exist in the WinAPI, then I'd need examples of the params you want them to accept...(& maybe a pointer to the WinAPI you want me to wrap them onto {if not the one already linked})...
Note: AutoHotkey's Server's Clock is 1min fast |
Keywords from my post are, "If I was not broke".
We are living from hand to mouth, in a month or two, I can affords this, now I cannot. That is why I spent days trying to understand this stuff.
I am sick as well, I will have to try these things tomorrow. Sorry.
I apriciate everyone trying to help. _________________ CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Mar 09, 2010 9:19 pm Post subject: Re: 64 bit regdel. You need to know C++ to help me. |
|
|
| DeWild1 wrote: | | Keywords from my post are, "If I was not broke". |
...no, the quote is...
| DeWild1 wrote: | | Seriously, I have was not broke, I would pay $1000 for this help! |
..."I have was not broke"...is not completely understandable, but since you own a computer biz (or several {what is the difference between them all?}), I took that as "I am not broke"...
| DeWild1 wrote: | | We are living from hand to mouth... |
...I have no desire to take someone's last dollar, I just would like to start making money writing AutoHotkey scripts for people (or doing any computer-related thing)...
| DeWild1 wrote: | | ...in a month or two, I can affords this, now I cannot. |
...I'm not sure how a month or 2 will help you afford $1000 dollars for a script, but if so, send me a check in a month or 2...(or you should decide if you're broke or not)...
Technically, I write scripts for people all the time for free...but if people really have money, then I'd suggest they share it... |
|
| Back to top |
|
 |
DeWild1
Joined: 30 Apr 2006 Posts: 358 Location: Shigle Springs
|
Posted: Wed Mar 10, 2010 11:38 pm Post subject: |
|
|
I have been expecting not to be broke for years
Honestly though, the ONLY thing that separates us from a multimillion dollar company is we have no funding to get advertising. However, I have figured out a way to get about 50 new clients a day for free, I am also working on two for sure ways to get $20-$30K in the next two months that will fund my advertising campaign.
I will share when we are going OK.
Many names, one great service, read this, and you shall believe, http://www.computerrepairinsacramento.com/Vindemiatrix-Porrima-Computer-Repair-in-Sacramento.htm
Yes, I know I messed up on wording, I am sick and I get dumber with sickness.
Now, if anyone knows C++ and can make these functions to set permissions and owner on the reg, and can help me, yes, I will give you $1000 in 2 months.
Ask tank, he knows I am honest and he has done some work for me, but COM stuff.
My CPULOCK changes permissions on reg keys but the way it works sucks.
Plus I think MS just gave out an update on windows 7 that it wants signed drivers on the 64 bit just like they did not stupid Vista 64.
So I am tired or rewriting code and I just want a 64 or 32 bit program in AHK that so that I will not have to do such confusing things, but with http://www.autohotkey.com/forum/viewtopic.php?p=338338#338338 IronAHK man, that will become a reality soon, so never mind the regdelete() stuff, just permissions() and ownership()
[/b] _________________ CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Mar 11, 2010 12:38 am Post subject: |
|
|
| DeWild1 wrote: | | ...we have no funding to get advertising. |
...I saw your stuff on YouTube (or wherever) that had you on your local news...(before I found out you were also here at AutoHotkey {small world})...so that's at least some advertising...I don't wanna turn this post in to an ad, but if you need things printed, anything printed, I know of a print shop...I'll probably PM you that info if you want it tho...
| DeWild1 wrote: | | Many names, one great service... |
...that's my question, why so many names?...makes it confusing which website to go to for service...
| DeWild1 wrote: | | Now, if anyone knows C++ and can make these functions to set permissions and owner on the reg |
...I don't know alot of C++, but I think I do know enough to write this...unless, once I dig in, I hit a roadblock...Microsoft loves their endless function/struct hell...I will try it sometime & post my results... |
|
| Back to top |
|
 |
DeWild1
Joined: 30 Apr 2006 Posts: 358 Location: Shigle Springs
|
Posted: Thu Mar 11, 2010 2:27 am Post subject: |
|
|
911pcfix.com always got people to do pcfix911,or pcfix, or 911fix, etc. virusSWAT was OK but does not say what we do.
guaranteed, no one can spell.
Do they even know they are infected, maybe 50% of time.
Do they even know what is wrong with their PC, maybe 20% of time.
I would go on, but I would give away my 50+ new clients a day system.
But you think my sig has many names, trust me, that is nothing.
Printing, LOL, old school. Internet = Millions of petential clients.  _________________ CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Mar 11, 2010 4:19 am Post subject: |
|
|
| DeWild1 wrote: | | Printing, LOL, old school |
...OK, you don't need fliers or any paper thing?...just asking... |
|
| Back to top |
|
 |
DeWild1
Joined: 30 Apr 2006 Posts: 358 Location: Shigle Springs
|
Posted: Thu Mar 11, 2010 6:22 pm Post subject: |
|
|
| Anonymous wrote: | | DeWild1 wrote: | | Printing, LOL, old school |
...OK, you don't need fliers or any paper thing?...just asking... |
No thanks. We tried door to door flyers. We got 1 out of a thousand.
We tried direct mail, 0 out of a thousand.
When I can afford it, TV worked best, we got thousands from a few spots.
Our 888-677-7777 is hard to forget so combining that plus a testimonial and the fact that we offer something no one else does, has worked best.
Anyways, does anyone understand http://msdn.microsoft.com/en-us/library/aa379314%28VS.85%29.aspx and could they port it into a function. _________________ CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|