CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
win32:registry question

 



user100
New User

Oct 17, 2010, 4:20 PM

Post #1 of 7 (11141 views)
win32:registry question Can't Post

Hi,

How can I write to the registry startup so my app will startup each time when windows starts?



Thanks.


FishMonger
Veteran / Moderator

Oct 17, 2010, 7:37 PM

Post #2 of 7 (11139 views)
Re: [user100] win32:registry question [In reply to] Can't Post

Win32::TieRegistry - Manipulate the Win32 Registry
http://search.cpan.org/~adamk/Win32-TieRegistry-0.26/lib/Win32/TieRegistry.pm


user100
New User

Oct 22, 2010, 7:23 AM

Post #3 of 7 (11084 views)
Re: [FishMonger] win32:registry question [In reply to] Can't Post

Could you write me an example?


FishMonger
Veteran / Moderator

Oct 22, 2010, 4:58 PM

Post #4 of 7 (11078 views)
Re: [user100] win32:registry question [In reply to] Can't Post

Have you tried any of the examples that are in the documentation that I pointed you to?

What part do you not understand?

Post your test code and any errors/warnings that it generates and ask a specific question on the part of the script that is giving you trouble.


user100
New User

Oct 24, 2010, 11:55 AM

Post #5 of 7 (11029 views)
Re: [FishMonger] win32:registry question [In reply to] Can't Post

Yes I have.


Code
#!/usr/bin/perl 

#use Win32::Registry;
#my $Register = "Software";
#my $hkey,$SubKey;

#$HKEY_LOCAL_MACHINE->Open($Register,$hkey)|| die $!;
#$hkey->Create("FunStuff",$SubKey);
#$hkey->Close();


#----------------

[ $SubKeyObj = ] $obj->Create("SubKey" [,$SubKeyObj] )
[ $SubKeyObj = ] Win32::Registry::Create("absolute path","SubKey" [,$SubKeyObj])
$SubKeyObj=$RegObj->Create( "SubKey")
or die "Cannot create SubKey.\n";
$RegObj->Create( 'SubKey\SubSubKey',$SubSubKeyObj )
or die "Cannot create SubKey.\n";
$Jenda = Win32::Registry::Create('HKEY_LOCAL_MACHINE\SOFTWARE','Jenda');


Here is some stuff I used.

And here are the errors:


Code
Scalar found where operator expected at reg line 14, near "] $obj" (Missing operator before $obj?) 

Bareword found where operator expected at reg line 15, near "] Win32::Registry::Create"
(Missing operator before Win32::Registry::Create?)

Scalar found where operator expected at reg line 16 near ") $SubKeyObj" (Missing semicolon on previous line?)
syntax error at reg line 14, near "= ]" reg compilations errors.



FishMonger
Veteran / Moderator

Oct 24, 2010, 1:40 PM

Post #6 of 7 (11025 views)
Re: [user100] win32:registry question [In reply to] Can't Post

Win32::Registry is obsolete and even its author says you should be using Win32::TieRegistry, which is the one I linked to.

Throw that code away and start over and use the Win32::TieRegistry module.


user100
New User

Oct 24, 2010, 6:53 PM

Post #7 of 7 (11017 views)
Re: [FishMonger] win32:registry question [In reply to] Can't Post

Could you write an example though of the whole code, if you don't mind?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives