944,058 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Apr 27th, 2006
0

about registry key . . .

Expand Post »
hello guys,

just want to ask if you have a module for adding/deleting of registry key easily, I have tried reading some articles and they have given some of their examples.. but its not working... i'm working now on adding this registry key

HKEY_CLASSES_ROOT
Folder\shell\Use Zip Help\command
ValueName = (Default)
RegValue= "C:\Program Files\Zip Help\Zip Help.exe" "%1"

thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astroboy_x4 is offline Offline
8 posts
since Apr 2006
Apr 27th, 2006
0

Re: about registry key . . .

Adding it is a lot easier than deleting. Namely, because deleting usually requires that the key be empty, so that it can not contain any sub-keys or values. Adding The key/Value is pretty easy with scripting, like so:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. dim wsh
  2. set wsh = createobject("WScript.Shell")
  3. wsh.regwrite "HKCR\Folder\shell\Use Zip Help\command", "C:\Program Files\Zip Help\Zip Help.exe " & chr(34) & "%1" & chr(34), "REG_SZ"
The deleting process however, will require you to enumerate the key you want to delete (for both sub-keys and values) delete all of those, and then delete the key in question. When I get home from work I'll post the code for enumeration and deleting.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Apr 27th, 2006
0

Re: about registry key . . .

thanks for the reply... I have tried your code and its a lot more simplier than the others I read, but I need to have a key equals to "(Default)" with key value = "C:\Program Files\Zip Help\Zip Help.exe" "%1", I tried to modify the code you given me but the result looks like this
http://10.34.193.20:1410/key%20value.bmp
and two "(Default)" keys are created, thus the registry doesn't work at all

by the way, I'm adding this registry to add a right click menu option for my VB programs

thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astroboy_x4 is offline Offline
8 posts
since Apr 2006
Apr 27th, 2006
0

Re: about registry key . . .

Reputation Points: 11
Solved Threads: 0
Light Poster
mrmike is offline Offline
41 posts
since May 2005
Apr 27th, 2006
0

Re: about registry key . . .

oops, I forgot the slash after.... try this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. dim wsh
  2. set wsh = createobject("WScript.Shell")
  3. wsh.regwrite "HKCR\Folder\shell\Use Zip Help\command\", "C:\Program Files\Zip Help\Zip Help.exe " & chr(34) & "%1" & chr(34), "REG_SZ"
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Apr 27th, 2006
0

Re: about registry key . . .

Great!! adding of new registry key from vb program is working now and a lot more easier....

Using this registry key will add a new menu(Use Zip Help) everytime we right click on a "Folder"... any idea how to get the location path of the folder clicked and pass it to the VB program... lets say we have a simple VB application consisting of a text box and a command button, the program works like this, any text enter in the text box will be shown every time we clicked on the command button.... now the registry we just add will just open the vb application without passing any information... any idea doing this?

thanks a lot
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astroboy_x4 is offline Offline
8 posts
since Apr 2006
Apr 28th, 2006
0

Re: about registry key . . .

I wrote a program for people who need to quickly change the file extention of a program, on windows machines that have explorer hide the file extention. It adds a menu to any file that is right clicked, and gives you the option to select the program. Once the program is loaded, it automatically loads the filename of the program chosen. I'm guessing this is your plan, since I don't fully understand your question, but let me know if this helps.
Attached Files
File Type: zip QuickRen.zip (6.2 KB, 72 views)
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
May 2nd, 2006
0

Re: about registry key . . .

Comatose,

I tried using the file you attached... maybe its just me.. but I still can't get the result I want.... I have attached a simple program, this program should show the text in the text box by msgbox upon clicking on the command button, from my previous post after add the registry value... it give us new option when we right click a "Folder" and allowing us to call the program easily, now for my follow up question can we pass the location of the right clicked "Folder" and directly pass it to the checkbox so we don't need to type the location in the text box, so we simply click on the command button showing us the location of the Folder

thanks a lot
Attached Files
File Type: zip help.zip (3.6 KB, 50 views)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astroboy_x4 is offline Offline
8 posts
since Apr 2006
May 3rd, 2006
0

Re: about registry key . . .

The only thing I see is a button that msgbox's the text in the textbox. Help me out here, I need a layout of exactly what needs to happen. What should the right-click menu say? What should happen when it's selected? Does it need to know the filename that was clicked on? If so, why?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
May 4th, 2006
0

Re: about registry key . . .

the attached file is just an example, though the idea is still the same
1. using the attached file (help.zip) we will add a right click menu using the registry, so if the created exe file is named "Project1.exe" then when the project is loaded it will create a registry key something like this..
>>> "HKCR\Folder\shell\Use Project1\command\", "C:\Program Files\Zip Help\Project1.exe " & chr(34) & "%1" & chr(34), "REG_SZ"
*** this part was already solve
2. For the second question, is there a way that when we right click a folder, and click "Use Project1" from the right click menu it will then pass the folder location to the textbox within Project1.exe, so that when we use the rigth click, we don't have to enter it in the text box

3. "What should the right-click menu say? What should happen when it's selected? Does it need to know the filename that was clicked on? If so, why? "
>>> refencing from the attached file the right-click menu say "Use Project1", when it selected Project1.exe will be activated, and it should know the location of the folder selected, doing this will help the user not to browse the folder and get its location easily

hope I have make my point clear =)

thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astroboy_x4 is offline Offline
8 posts
since Apr 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Cutting Down String Split Overhead
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB Syntax error appears in one page but not the other?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC