| View previous topic :: View next topic |
| Author |
Message |
wezel Freshman
Joined: 09 Oct 2003 Posts: 30
|
Posted: Oct 20th, 2003 12:19 PM Post subject: Adding to the registery with *.reg |
|
|
Hi,
I''ve tried to understand editing the registery with API calls and stuff, but decided that i'd try it with making a *.reg file and then adding it to the registery cause I don't understand the way with the API calls
Here's the code I use to add a program to run on start-up:
| Code: |
Dim strRegPath as string
strRegPath = App.Path & "\AutoRun.reg"
Open strRegPath For Output As #1
Print #1, "REGEDIT4"
Print #1, ""
Print #1, "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"
Print #1, Chr(34) & "Reminder" & Chr(34) & "=" & Chr(34) & App.Path & "\Reminder.exe" & Chr(34)
Close #1
Shell "regedit /s " & strRegPath, vbNormalFocus
|
Now the thing is; With a "/" in the Value it doesn't seem to work
For example if i would change
App.Path & "CheckReminder.exe"
into Reminder.exe it works, but not if the value is a full path...
Any idea how to solve this ?
Thanx at advance!
Wesley _________________ Real Programmers don't comment their code - it's hard to write, it should be hard to read |
|
| Back to top |
|
wezel Freshman
Joined: 09 Oct 2003 Posts: 30
|
Posted: Oct 21st, 2003 07:32 AM Post subject: |
|
|
Hi,
hmm ok, nevermind, I tried the module from P.T.A.M. again and i understood the part to set the program on startup, so I'm going to do make with the API calls.
Thank again P.T.A.M., cool module! _________________ Real Programmers don't comment their code - it's hard to write, it should be hard to read |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 21st, 2003 10:10 AM Post subject: |
|
|
Not mine but you're welcome
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 21st, 2003 10:13 AM Post subject: |
|
|
I don't understand what you mean here :
| Quote: | Now the thing is; With a "/" in the Value it doesn't seem to work
For example if i would change
App.Path & "CheckReminder.exe"
into Reminder.exe it works, but not if the value is a full path...
Any idea how to solve this ? |
_________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
wezel Freshman
Joined: 09 Oct 2003 Posts: 30
|
Posted: Oct 23rd, 2003 04:56 AM Post subject: |
|
|
What I meant was: When the value i send to the registery contains the char '/' it didn't work.
Wesley _________________ Real Programmers don't comment their code - it's hard to write, it should be hard to read |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 23rd, 2003 05:23 PM Post subject: |
|
|
I have no problem adding a "/" in the value. I tried this and it worked fine...
| Code: | | REGSaveSetting vHKEY_LOCAL_MACHINE, "SOFTWARE\PTAM", "test", "b/b/b" |
I used the module I attached in the other thread...
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
wezel Freshman
Joined: 09 Oct 2003 Posts: 30
|
Posted: Oct 23rd, 2003 05:43 PM Post subject: |
|
|
The module works great, I meant that it didn't work with a "/" included in the value if you do it the other way: No API calls, but with making a *.reg file and adding it to the registery:
shell "regedit /s Filename.reg" (or something)
But i'm do it the API way now, that way it works fine
Wezel _________________ Real Programmers don't comment their code - it's hard to write, it should be hard to read |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 23rd, 2003 05:46 PM Post subject: |
|
|
I never would have guessed that it wouldn't work the other way! Weird... Anyway if it works, no worries
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|