Jeff Westman wrote: > Tim Johnson <[EMAIL PROTECTED]> wrote: > > > Granted, I'm on XP, but I can't seem to reproduce your error. I created a > > file at the path specified and it works perfectly. Are you sure that you > > have the exact filename and that you have access to it? (I guess it's > > windows 98, so you pretty much have access to everything...) Try pasting > > the printed out version of the file at the Run... prompt and see if you can > > open it. You may have to put double-quotes around it when you do this. > > > > The following code works for me: > > > > ######################################### > > > > use strict; > > use warnings; > > > > my $file = "c:\\win\\start menu\\programs\\system\\tbs montego\\_visit > > turtle beach web site.lnk"; > > print "file = \"$file\"\n"; > > open(F, "< $file") or warn "cannot open $file (continuing): $!\n"; > > while(<F>){ > > print; > > } > > close(F); > > > > ######################################### > > > > Of course, .lnk files are not text files, so if you really want to > > manipulate the link, you should use Win32::Shortcut. > > The above code you sent me gave me the same error: > > file = "c:\win\start menu\programs\system\tbs montego\_visit turtle beach web > site.lnk" > cannot open c:\win\start menu\programs\system\tbs montego\_visit turtle beach > web site.lnk (continuing): No such file or directory > readline() on closed filehandle F at x1.pl line 7. > > Also, the Win32::Shortcut has some short-comings, basically, it cannot break > down the modifier codes for shortcuts, so I wrote my own. > > Thanks, > > Jeff
Just in case there is a possiblity of misspelling, my suggestion for any long, hard-coded path in Windows would be to: 1. Make sure that the address bar is showing in Windows Ecplorer, and that your options are set to show the full path 2. Select the directory/file you are looking for and copy the location. Don't know if this will help, or if there is any sort of s[elling error involved. I do know that at least Perl 5.8 ActiveState, is quite adept at handling long filenames: Greetings! E:\d_drive\perlStuff>perl -w open IN, 'C:\Documents and Settings\rjnewton\Desktop\test_reg.reg' or die "Could not open: $!"; print for (<IN>); close IN; ^Z HKEY_LOCAL_MACHINE\\SOFTWARE\\R. J. Newton [EMAIL PROTECTED] HKEY_LOCAL_MACHINE\\SOFTWARE\\R. J. Newton IdeaWorks\\TestReg\\Success\\is sweet Greetings! E:\d_drive\perlStuff>perl -w open IN, 'C:\Documents and Settings\rjnewton\Desktop\Windows Media Player' or di e "Could not open: $!"; print for (<IN>); close IN; ^Z Could not open: No such file or directory at - line 1. Greetings! E:\d_drive\perlStuff>perl -w open IN, 'C:\Documents and Settings\rjnewton\Desktop\Windows Media Player.lnk' o r die "Could not open: $!"; print for (<IN>); close IN; ^Z L ?¶? ? FÅ P? ?d??????li??? ?Wñ}í?? ? ? £ ¶ ?P?O? ?:i?ó +00¥? #C:\ 1ä% 1 b.?¶1 Program Files PROGRA~1 , 1 b.?¶0 Windows Media Playe r WINDOW~2 ? 2 ? î-p? wmplayer.exe a ? ? ? - ` ? ? x\? ? C:\Program Files\Windows Media Player\wmplayer.exe J P l a y s y o u r d i g i t a l m e d i a i n c l u d i n g m u s i c , v i d e o s , C D s , a n d I n t e r n e t R a d i o . 8 . . \ . . \ . . \ P r o g r a m F i l e s \ W i n d o w s M e d i a P l a y e r \ w m p l a y e r . e x e ? ? á& R ` ? áX joseph_home ??â:0yBM½?C??~§e"?3??L??ó? P?C ĺ??â:0yBM½?C??~§e"?3??L??ó? P?Cĺ I'd say chek your spelling. All of the above were done using the method I described. The only hack I had to apply was to add the still-hidden .lnk extension [it's one of a small set that is hidden even when standard extensions are shown. I'll track down the Registry setting later.] Remember KISS. Apply minimal hacking, you should get good results. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]