Editing the Registry

Discussions on Software that do not yet fit into any of the current Software fora.

Moderator: Software Moderators

Editing the Registry

Postby Spock » Wed 2006 May 03 10:47

Ref: http://support.microsoft.com/kb/310516
Ref: http://www.robvanderwoude.com/index.html
Ref: http://www.robvanderwoude.com/regedit.html

I had to call Tech Support about my new HP computer and, after about 30 minutes of frustration, was told I would have to do a System Recovery. I got a case number and hung up so I could back up my system to another networked computer.

When I called today and talked to another technician, he talked me through a Registry change that solved the problem. He wasn't aware that you could create an ASCII text file that would do the same thing when run, so I told him I would find out how to do so and let him know.

The information is too good to keep hidden but PLEASE only try this if you know what you are doing as the entries will be different from one OS to another and may even be different from one version of an OS to a different version.

You must create an ASCII text file using any pure ASCII text editor like NotePad but save it with a .reg extension. More information below from the above referenced website.

Removing registry entries
To remove an entire "tree" from the registry using REGEDIT and a .REG file, just add a minus sign before the tree name:

REGEDIT4

[-HKEY_CURRENT_USER\DummyTree]

will remove the entire tree "DummyTree".

To remove an individual item from the registry, place the minus sign after the equal sign:
REGEDIT4

[HKEY_CURRENT_USER\DummyTree]
"ValueToBeRemoved"=-

will remove the individual value "ValueToBeRemoved" from "DummyTree".
This is demonstrated in the uniqueid.bat example below, a batch file that forces a new LANDesk agent ID.

More info can be found at Regedit.com's Registry FAQ.

How to remove an individual registry key or value using *.INF files and RUNDLL is explained here by Bill James.

NT 4 users who own a copy of the NT 4 Resource Kit can also use REG.EXE to remove registry entries.
In Windows 2000 and later REG.EXE is a native tool.


===========================
uniquid.bat


Code: Select all
@ECHO OFF
:: No command line parameters required
IF NOT "%1"=="" GOTO Syntax

:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: Adjust the LANDesk server name and the drive and directory if necessary ::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
SET LANDeskServer=MyLDServer
C:
CD\LDClient

ECHO Removing old LANDesk agent ID

:: Delete old ID file (adjust drive if necessary)
IF EXIST C:\LDIScan.cfg ATTRIB -h -r -s C:\LDIScan.cfg
IF EXIST C:\LDIScan.cfg DEL C:\LDIScan.cfg

:: Delete old ID from the registry (Local Machine)
:: Create a temporary REG file
> %TEMP%.\UniqueID.reg ECHO REGEDIT4
>>%TEMP%.\UniqueID.reg ECHO.
>>%TEMP%.\UniqueID.reg ECHO [HKEY_LOCAL_MACHINE\SOFTWARE\Intel\LANDesk\Common Api]
>>%TEMP%.\UniqueID.reg ECHO "UniqueID"=-
>>%TEMP%.\UniqueID.reg ECHO.

:: Check if previous ID was stored for Current User and if so, delete it
IF EXIST %TEMP%.\_Unique_.REG DEL %TEMP%.\_Unique_.REG
REGEDIT /E %TEMP%.\_Unique_.REG "HKEY_CURRENT_USER\SOFTWARE\Intel\LANDesk\LDWM\LDIScan32"
TYPE %TEMP%.\_Unique_.REG | FIND /I "Last Device ID" >NUL 2>&1
IF ERRORLEVEL 1 GOTO Next
>>%TEMP%.\UniqueID.reg ECHO [HKEY_CURRENT_USER\SOFTWARE\Intel\LANDesk\LDWM\LDIScan32]
>>%TEMP%.\UniqueID.reg ECHO "Last Device ID"=-
>>%TEMP%.\UniqueID.reg ECHO.

:: Repeat for Default User
:Next
IF EXIST %TEMP%.\_Unique_.REG DEL %TEMP%.\_Unique_.REG
REGEDIT /E %TEMP%.\_Unique_.REG "HKEY_USERS\.Default\SOFTWARE\Intel\LANDesk\LDWM\LDIScan32"
TYPE %TEMP%.\_Unique_.REG | FIND /I "Last Device ID" >NUL 2>&1
IF ERRORLEVEL 1 GOTO Merge
DEL %TEMP%.\_Unique_.REG
>>%TEMP%.\UniqueID.reg ECHO [HKEY_USERS\.Default\SOFTWARE\Intel\LANDesk\LDWM\LDIScan32]
>>%TEMP%.\UniqueID.reg ECHO "Last Device ID"=-
>>%TEMP%.\UniqueID.reg ECHO.

:: Merge (import) the REG file to delete the UniqueID entry
:Merge
REGEDIT /S %TEMP%.\UniqueID.reg
:: Delete the temporary REG file
DEL %TEMP%.\UniqueID.reg

ECHO Creating new LANDesk agent ID

:: Start inventory scan to create new ID
LDISCN32.EXE /NTT=%LANDeskServer%:5007 /S="%LANDeskServer%" /I=\\%LANDeskServer%\LDLOGON\ldappl.ini /V

ECHO Done
IF EXIST %TEMP%.\_Unique_.REG DEL %TEMP%.\_Unique_.REG
SET LANDeskServer=
CD\
GOTO End

:Syntax
ECHO UniqueID.bat,  Version 2.00 for 32-bit Windows
ECHO Create a new unique ID for Intel LANDesk agent
ECHO.
ECHO If a computer is installed using a harddisk image (like Norton Ghost
ECHO or PowerQuest's Drive Image) all "clones" will have the same LANDesk
ECHO agent ID if LANDesk agent was installed when the image was created.
ECHO However, the LANDesk agent needs a unique ID to function properly.
ECHO You can force a new ID by reinstalling the LANDesk agent software,
ECHO but running this batch file can force a new unique ID just as well.
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com

:End
User avatar
Spock
Forum Admin
Forum Admin
 
Posts: 2417
Joined: Tue 2005 Jan 18 10:47
Location: MD, USA

interesting

Postby cmptch » Sat 2006 May 06 4:38

what was going on with your new machine to require a registry edit? I'm intrigued. I've also been in the business a few years now and have been going through regedit key by key with their crappy organizational system. It's some good info, and I'm going to do some thorough investigation into exploiting the use of that to make my job easier. Appreciate you not keeping it a secret. I just wish I could reorganize the registry the way I would like it.
User avatar
cmptch
Master Achiever
Master Achiever
 
Posts: 217
Joined: Sun 2006 Apr 23 3:05
Location: Dalzell, IL

Postby Krank » Sat 2006 May 06 4:53

Well, this could be me, but whenever someone manully needs to edit the reg. with or without a file, make sure you back it up before you go any further.

I have had to tell this to peeps much to often, its just good advice so if this is "free" info to teach peeps, (note that your doing something pretty deep within windows, hence my consirn), add this always.

Dont get me wrong, im a person who firmly believes in education, even when it can go wrong, systemwise.
How to make a Direct-X File

new system:
Gigabite p35 DS3R
Award software international, F11, 01-04-2008
Intel E8200 "wolfsdale" intel core duo
OCZ ddr2 pc2-6400 Gold kit, 4 gig.
maxtor hdd, 80 gig, ide
Peak Radeon HD 3850 512 mb pcie
Liteon dvd rom, ide
Fortron BlueStorm 500w
Windows xp pro sp2
User avatar
Krank
Honored Achiever
Honored Achiever
 
Posts: 190
Joined: Sun 2005 Dec 18 5:01
Location: The Netherlands

Postby cmptch » Sat 2006 May 06 8:04

krank wrote:...make sure you back it up before you go any further...


your darn right, although sometimes not backing up sure does make it interesting sometimes.

heck, nowadays it seems you can't USE Windows without a full hdd image.
User avatar
cmptch
Master Achiever
Master Achiever
 
Posts: 217
Joined: Sun 2006 Apr 23 3:05
Location: Dalzell, IL

Postby Ben Last » Sat 2006 May 06 8:57

Yeah I've come across this feature before, it seems quite useful although I've never actually used it to edit my own registry.

I built a file for someone once to add 'open in Notepad' to the right click context menu for every file type. For that sort of thing it is really useful.
No trees were harmed in the construction of this message, however many electrons were terribly inconvenienced.
User avatar
Ben Last
Consulting Ambassador
Consulting Ambassador
 
Posts: 475
Joined: Fri 2005 Jan 21 7:47
Location: Stowmarket

Postby Spock » Sat 2006 May 06 10:55

All my video drives somehow became disconnected. The registry edit was fairly simple, easy to do, and my drives were again recognized. The Registry Edit to reconnect them is as follows:

Registry Editor for CD/DVD drives being disconnected:

My Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}

Modify all UpperFilters and LowerFilters entries and delete them.


Ben Last wrote:... I built a file for someone once to add 'open in Notepad' to the right click context menu for every file type. For that sort of thing it is really useful.


Care to share it with us? :)
User avatar
Spock
Forum Admin
Forum Admin
 
Posts: 2417
Joined: Tue 2005 Jan 18 10:47
Location: MD, USA

Postby cmptch » Sat 2006 May 06 11:25

Spock wrote:All my video drives somehow became disconnected.


I had to look up "video drive". After all, our disributers calls them optical drives. That's a really common issue after installing certain burning software. HP's images are known for issues like that.

If it's a brand new system, I wonder if there's an issue with the image they threw on your model.
User avatar
cmptch
Master Achiever
Master Achiever
 
Posts: 217
Joined: Sun 2006 Apr 23 3:05
Location: Dalzell, IL

Postby Spock » Sun 2006 May 07 2:56

Your right, I should have said Optical drives. I have:

1 DVD-ROM
1 DVD-RW
1 External DL DVD-RW

The system is fairly new but I had to remove Nero, so that may or may not have had something to do with it.
User avatar
Spock
Forum Admin
Forum Admin
 
Posts: 2417
Joined: Tue 2005 Jan 18 10:47
Location: MD, USA

Postby Ben Last » Sat 2006 May 13 8:02

Spock wrote:
Ben Last wrote:... I built a file for someone once to add 'open in Notepad' to the right click context menu for every file type. For that sort of thing it is really useful.


Care to share it with us? :)

This was a post I had made on another forum, and it appears to have been pruned now, but if I find the file on my pc I'll make sure to post it.
No trees were harmed in the construction of this message, however many electrons were terribly inconvenienced.
User avatar
Ben Last
Consulting Ambassador
Consulting Ambassador
 
Posts: 475
Joined: Fri 2005 Jan 21 7:47
Location: Stowmarket

Postby cmptch » Sat 2006 May 13 9:53

This is to add "open with notepad" to the right-click(context) menu in Reg Edit. I've verified that this works on windows xp.
Code: Select all
In Windows Registry editor(start:run:regedit)

Open: HKEY_CLASSES_ROOT\* (note: this is the exact text)
--Create sub-key: shell
----Create sub-key: Open with Notepad (note:this will be the displayed text)
------Create sub-key: command
--------Modify the default value: notepad "%1"


http://windowsxp.mvps.org/context_folders.htm This site contains some information regarding the context menu, but doen't provide information on how keys and their structure work.
Last edited by cmptch on Sat 2006 May 20 9:54, edited 4 times in total.
________________
"Backup your data, unless you want to lose it." --Your friendly neighborhood Hardware Dude.
User avatar
cmptch
Master Achiever
Master Achiever
 
Posts: 217
Joined: Sun 2006 Apr 23 3:05
Location: Dalzell, IL

Postby Spock » Sat 2006 May 13 10:07

cmptch wrote:This is to add "open with notepad" ...


Ah but the trick is to create a file that does that automatically without having to rely on the end user knowing how to access the registry. ;)
User avatar
Spock
Forum Admin
Forum Admin
 
Posts: 2417
Joined: Tue 2005 Jan 18 10:47
Location: MD, USA

Postby cmptch » Sat 2006 May 13 10:09

yes, I was editing my post while you posted that. That info is now included.
________________
"Backup your data, unless you want to lose it." --Your friendly neighborhood Hardware Dude.
User avatar
cmptch
Master Achiever
Master Achiever
 
Posts: 217
Joined: Sun 2006 Apr 23 3:05
Location: Dalzell, IL

7 Easy Steps to add "Open With Notepad" on Right C

Postby cmptch » Sat 2006 May 20 9:51

Here's how to create a "Open With Notepad" registry file for Windows XP:
1. Open Notepad (Start:All Programs:Accessories:Notepad)
2. Insert the Code at the bottom of the page exactly as it appears
3. Save the file as notepad.reg (File:Save As) to the desktop.
4. Right Click on the file.
5. Click Merge.
6. Click "Yes" on the dialog box,
7. Click "ok" on the dialog box.

You do not need to restart the computer in windows xp.

Code: Select all
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*]

[HKEY_CLASSES_ROOT\*\Shell]

[HKEY_CLASSES_ROOT\*\Shell\Open With Notepad]

[HKEY_CLASSES_ROOT\*\Shell\Open With Notepad\Command]
@="notepad \"%1\""
________________
"Backup your data, unless you want to lose it." --Your friendly neighborhood Hardware Dude.
User avatar
cmptch
Master Achiever
Master Achiever
 
Posts: 217
Joined: Sun 2006 Apr 23 3:05
Location: Dalzell, IL

Postby cmptch » Sat 2006 May 20 10:29

I've been doing alot of PHP editing lately, and ftp tends to mess up the formatting. wordpad usually corrects this formatting, so adding "Open With Wordpad" to the context menu has really helped out. Extemely important information at bottom of post.

Here's how to create a "Open With Wordpad" registry file for Windows XP:
1. Open Notepad (Start:All Programs:Accessories:Notepad)
2. Insert the Code belowexactly as it appears
3. Save the file as wordpad.reg (File:Save As) to the desktop.
4. Right Click on the file.
5. Click Merge.
6. Click "Yes" on the dialog box,
7. Click "ok" on the dialog box.

You do not need to restart the computer in windows xp.

Code: Select all
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*]

[HKEY_CLASSES_ROOT\*\Shell]

[HKEY_CLASSES_ROOT\*\Shell\Open With Wordpad]

[HKEY_CLASSES_ROOT\*\Shell\Open With Wordpad\Command]
@="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe \"%1\""


IMPORTANT INFO:
You'll notice the use of double backslashes("\") in the following line:

@="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe \"%1\""

If the double backslashes are not present, then the registry editor will not recognize it, and will skip it. When you try to use the command, it will give an error.
________________
"Backup your data, unless you want to lose it." --Your friendly neighborhood Hardware Dude.
User avatar
cmptch
Master Achiever
Master Achiever
 
Posts: 217
Joined: Sun 2006 Apr 23 3:05
Location: Dalzell, IL

Postby Spock » Mon 2006 May 22 4:50

Thanks for the info cmptch. Your last two posts should be enough to get any budding Registry Crashers started. }:->

A word to the beginners (the wise already know it):

ALWAYS BACKUP YOUR REGISTRY BEFORE MAKING ANY CHANGES!!!
User avatar
Spock
Forum Admin
Forum Admin
 
Posts: 2417
Joined: Tue 2005 Jan 18 10:47
Location: MD, USA


Return to General SW

Who is online

Users browsing this forum: No registered users and 2 guests

cron