?
Solved

Delete Reg key

Posted on 2006-03-31
18
Medium Priority
?
339 Views
Last Modified: 2010-04-13
Hey All,

Im trying to get a key in the registry deleted. Ive looked around and see there being 2 major choices. Using GP which seems quite a process or a login script which seems fairly simple.

Ive tried out using a reg file to remove the entry which works fine but the problem is if using it in a login script, the standard user does not have access to delete a key in registry, so it fails. So how do i get it done?

Thanks in advance

0
Comment
Question by:supernaut76
  • 7
  • 6
  • 3
  • +1
18 Comments
 
LVL 17

Expert Comment

by:Dushan De Silva
ID: 16342137
0
 
LVL 78

Expert Comment

by:Rob Williams
ID: 16342849
Perhaps in Group Policy use a start up script rather than a logon script. I believe it executes before logon and uses system/admin credentials.
Computer Configuration | Windows Settings | Scripts | StartUp
0
 

Author Comment

by:supernaut76
ID: 16354247
Thanks for the response guys, i will try and do some testing with group policy logon scripts. My pervious experinece with them though was i found it to be slower than a regular script, is that normal?

Also the tune up software, is the trial version a fully functionall version?

Thanks
D
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 78

Expert Comment

by:Rob Williams
ID: 16354702
>>"i found it to be slower than a regular script, is that normal"
No I haven't found that. It's the same script just being enforced by a different service, so it shouldn't be. If you have a lot of group policies.....a lot that is, it can slow down logons.
0
 
LVL 17

Expert Comment

by:Dushan De Silva
ID: 16354851
Hi supernaut76 !
tune-up trial version is not fully functional. You can have a look and if you interested with it you can get full version. I'm having personaly good experience with it. And please check following solutions too :)

http://www.experts-exchange.com/Applications/MultiMedia_Applications/Q_21778874.html#16232324
http://www.experts-exchange.com/Programming/Q_21797328.html
http://www.experts-exchange.com/Programming/Q_21797314.html
http://www.experts-exchange.com/Applications/Q_21761816.html


BR Dushan
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16356405
GP Login / Logoff and Startup scripts seem fine to me too, have many long ones running all over the place...

Another alternative is to give the user rights to the required registry key using a GPO then use your .REG file to delete it... look under Computer config, Windows settings, Security Settings, Registry.  Add the key and give suitable people rights.

hth

Steve
0
 

Author Comment

by:supernaut76
ID: 16358095
Tried the group policy script and i am still getting  a pop up "Do you want to add information to the registry..." So the user can still click on no and cancel the whole thing. How do i keep it hidden? The script is calling a registry file which deletes the key in question.

D
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 16365158
Try regedit /s regfile.reg

rather than just regedit regfile.reg  or  start regfile.reg


Steve
0
 
LVL 78

Expert Comment

by:Rob Williams
ID: 16366293
Sorry, ISP down most of today.
Try:
reg  delete  <key name>  /f
f = force

Use      reg  delete  /?      to read full syntax of command if you want specify full key, value, etc.
0
 

Author Comment

by:supernaut76
ID: 16368817
Ok guys i tried regedit /s regfile.reg in a group policy script and the script runs perfectly and the prompt is successfully suppressed. All looks good but...

The only problem is the reg key does not get deleted if i am logging in as a standard user. It does work when logging as an admin user. So the group policy script still uses permissions that the user has at login time.

D
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16373518
Correct.  See my post above about giving the user permissions through a GPO.

If you run it as a computer startup GPO script then it will run with local system rights rather than the user rights that the GPO user login script runs as...

Either way should make it work.  

Steve
0
 

Author Comment

by:supernaut76
ID: 16378677
Oops didnt see that...will give it a go a.s.a.p.
0
 

Author Comment

by:supernaut76
ID: 16379148
Ok so I added the same script to computer configuration, with the option to keep it visible (so i can see whats going on) but when you log in, you cannot see the script runnig and the reg key doesnt get deleted even if im logging in as an admin user.

How can it work under user config and not computer config? Am i doing something wrong?

D
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16385267
The computer startup script runs before the user logs in.  What is the key you are trying to update?  Is it under HKCU or HKLM (or elsewhere?).

I would really just do it through giving rights under GPO to your users then running it from the user logon script...

Steve
0
 

Author Comment

by:supernaut76
ID: 16389139
Its under HKLM\system\currentcontrolset\services

Stupid question where would i assign this right in GPO?

D
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16389508
see my post above.  if you need more than that let me know:

### Another alternative is to give the user rights to the required registry key using a GPO then use your .REG file to delete it... look under Computer config, Windows settings, Security Settings, Registry.  Add the key and give suitable people rights. ###

Steve
0
 

Author Comment

by:supernaut76
ID: 16389958
Thanks Steve, that did it...
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16390380
no prob. thanks for the points.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question