Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output

Post new topic   Reply to topic
Adding to the registery with *.reg
View previous topic :: View next topic  
Author Message
wezel
Freshman


Joined: 09 Oct 2003
Posts: 30

PostPosted: Oct 20th, 2003 12:19 PM    Post subject: Adding to the registery with *.reg Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
wezel
Freshman


Joined: 09 Oct 2003
Posts: 30

PostPosted: Oct 21st, 2003 07:32 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 21st, 2003 10:10 AM    Post subject: Reply with quote

Not mine but you're welcome Smile

Philip
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 21st, 2003 10:13 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
wezel
Freshman


Joined: 09 Oct 2003
Posts: 30

PostPosted: Oct 23rd, 2003 04:56 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 23rd, 2003 05:23 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
wezel
Freshman


Joined: 09 Oct 2003
Posts: 30

PostPosted: Oct 23rd, 2003 05:43 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 23rd, 2003 05:46 PM    Post subject: Reply with quote

I never would have guessed that it wouldn't work the other way! Weird... Anyway if it works, no worries Wink

Philip
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic