Current location: Hot Scripts Forums » Programming Languages » PHP » Reading .lnk file(shortcut files in windows)


Reading .lnk file(shortcut files in windows)

Reply
  #1 (permalink)  
Old 03-23-04, 05:00 AM
anupamsr's Avatar
anupamsr anupamsr is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Question Reading .lnk file(shortcut files in windows)

Hi,

I want to use a PHP script to show a .lnk(shortcut) file on the page pointing to the same link as that of the .lnk file.

By doing this, I will be able to store a index.php in the root folder and some .lnk files linking to files(and folders) to some other place, and my index.php will show all the .lnk files and clicking on which will send the user to desired place.

Any idea how to do this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-23-04, 08:53 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hello there,

Take a look at several .lnk files yourself - they are really text files with some directives. This is one example:

Code:
[DEFAULT]
BASEURL=http://sarahmclachlan.com/
[InternetShortcut]
URL=http://sarahmclachlan.com/
Modified=70AEF4144211C4013E
Another (with favicon)
Code:
[DEFAULT]
BASEURL=http://www.amazon.com/exec/obidos/tg/browse/-/3023481/ref%3Dtab%5Fm%5Fgw%5Fl/103-7590117-9950237
[InternetShortcut]
URL=http://www.amazon.com/exec/obidos/tg/browse/-/3023481/ref%3Dtab%5Fm%5Fgw%5Fl/103-7590117-9950237
Modified=60A40CEA4111C40111
IconFile=http://www.amazon.com/favicon.ico
IconIndex=1
Now, you know what's in there, so you can simply "parse" each .lnk file and extract what's necessary, then place them in a way you like. I hope this gives you some idea.

Nice project. Keep it up. =)
__________________
Blavv =|
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-24-04, 06:21 AM
SirRaven's Avatar
SirRaven SirRaven is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
They are 2 different things: .lnk and .url files. .lnk files point to local files and folders, meanwhile .url files point to a certain URL address (or file)...

You'd better make clear what are you referring at...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-24-04, 06:13 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Well,

As far as I can see, anupamsr never talked about .url, so I thought he/she will never use .url, but now come to think of it, actually the Internet shortcut file should be with .url and not .lnk - .lnk is for Windows shortcut file extension. The example I posted above are actually from .url files.
__________________
Blavv =|

Last edited by blaw; 03-24-04 at 06:39 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 03-27-04, 02:31 PM
anupamsr's Avatar
anupamsr anupamsr is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by blaw
Well,

As far as I can see, anupamsr never talked about .url, so I thought he/she will never use .url, but now come to think of it, actually the Internet shortcut file should be with .url and not .lnk - .lnk is for Windows shortcut file extension. The example I posted above are actually from .url files.
Infact I was refering to .lnk file(Windows Shortcut file which links to files and folders).

Here, I would like to clarify one thing:

I have a lan connection and I am sharing some materials which are stored on different computers. So, I have made a ftp server. For that purpose, I created some .lnk shortcut files(not .url) which refer to the files/folders on computers other than on which my server is running. My server is able to resolve these .lnk files, and it is all right.

Now, I want to have a http server(apache/php). This I want to resolve those links(just like my ftp).
But I don't know how to do this....

Any help? I know it is done and it is nothing related to Windows Source Code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 04-22-04, 03:42 PM
esnseeker esnseeker is offline
New Member
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Googling and a little digging yielded this:

http://www.wotsit.org/search.asp?page=23&s=ALLFILES

Scroll down to the LNK file extension.

It's unofficial and incomplete, but there is some sample code.

Bit of a kludge. 8-(
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
netadmin project - delete files georgeminton Visual Basic 0 03-03-04 05:03 PM
How to do fopen all files at a time and show one line from all files. Mouse PHP 0 03-01-04 09:33 PM
stopping direct download of my pdf files .. markmarkymark Script Requests 5 01-23-04 02:35 PM
Matrix Reseller - Windows 2003 and FreeBSD vortech General Advertisements 0 11-02-03 11:06 PM


All times are GMT -5. The time now is 12:32 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.