HTML Script for opening file in ur PC.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #188341

    I know in html u can use href=”” to open a webpage. But lets say u have an html or htm file in ur PC and want to open it in ur PC. Like lets say i make a page in html and i want a button to click and it will open the page thats stored on ur PC. How do i do this? Also, can i open a file like a exe file this way? Can i open all files in my PC using html script?

    Also, how would i do this in VB?


    so…you wanna open said file from ur browser, right?



    OK here’s what im trying to do…

    I’m going to make a prog that will make organizing my files easier.

    I want to make a link in the html files that will open up a file on my PC.

    and then I want those html files to be shown in the web browser in my prog.

    So then i will open up my prog n click the link of the file i want to open and it will open the file (whatever the file may be).

    How would i do this. I dont know the code for it.


    you lost me at ‘right…’ lol i dont understand what you’re trying to create this script in…


    i need to know how to open files stored on ur PC using html AND VB.

    cus: in the html page will be the links to the files on my PC. So i can click the link and the file will open. And i need THAT html page to be show in my VB WebBrowser. But that page will not be hosted. It will be stored on my PC. So i need the VB code to open the file from my PC also.

    Is this clear? i need both the VB and the html code to open a file thats in ur PC. 😀


    yes you can, and there is even little progs that will generate the html page for you, you just select the directorys, and the programs will scan them for files and generate the html page


    what is the name of that program? what should i type wen i google search it?

    Also, I this program will solve the html issue, I still need to know how to open a file from a VB WebBrowser as i stated….cus that html will not be hosted…it will be stored on my PC.

    P.S. I signed up for ur forum.


    thanks for the codes u IM’d me Ghost…..

    in the html code


    it will not load any files that are on the desktop. and it will not load other html pages that r in my pc. But it will load files stored in the Program Files directory.

    Also in the VB code:

    WebBrowser1.Navigate "file:///C:/urfile"

    it will only load files that r stored in program files directory and will not load other html pages that r stored in my PC.

    What is the reason for this? Although for wat im doing i can deal with only loading stuff from the Program Files Directory but i need it to load html pages too. It wont load html files. 😕 How do i do this? In VB and html.


    How would i make it so wen i click a button or label it will load the file or html? 8) 😉


    ok, i think the reason that its only opening the program files is because you didnt change the directory…maybe 😛 😛

    try this in the html file


    where ‘username’ is the username that ur on (i.e. ‘Administrator’)

    try that…if it works, then do the same in vb…

    now, as far as html goes, it should open the files locally, not in ur browser…it will only open folders in your browser…

    in vb, the ‘WebBrowser’ control will only open web pages…such as .html .htm .php and so on…hence ‘webbrowser’ 😀 im not sure if it will open folders tho, but it should…

    in vb, to make it load the folder when you click a command button or label, just move that ‘WebBrowser1.Navigate’ from form load to either ‘Command1_click’ or ‘Label1_click’ or something to that affect…didnt i already tell you that on aim? hehe

    P.S. i corrected ur html code 🙄


    um….it opens text files n picture files IN the web browser…and exe files open like they always do. Um..i cant get it to open html files for some reason….I changed the html to the documents n settings/username thing n it works now…but why wont it open html files.. 😕


    hmm…weirdness…for some reason, i cant put the internet control in the project…it says cannot find ieframe.dll but its there…i shall have to check on that…but when i do, ill get back to ya…cuz it should load html files…

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.