What's new

Help with VB6 pls

Olger901

Banned
Hello guys

My situation is the following:

I am makin an autorun with vb6

I made a few command buttons and typed them with Shell ("c:\examplemap\programname.exe") But now I want to run the program from a CD since this program is gonna be an autorun. But how do I do that? because on each pc a CD Drive is different like it could be D: or E: or even Z: so how could I make a program start from the exe file from any drive

2nd Question: Im trying to open a readme.txt file on the CD but it doesnt work with the shell command. How could I be able open a txt file by pressing a command button?

Pls help me out since I'm pretty much a n00b in vb
 

Eagle

aka Alshain
Moderator
Visual Basic, my expertese. OK, for directories, "..\Setup" means the root directory of the current directory, and in that root directory find the Setup Directory (so basically, go back one and find the Setup directory). ".\Setup" means, find the Setup sub-directory in the current directory (so basically stay here and find the Setup directory. The directory that this all refers too is the directory that the file is in.

Soooo...

Say you have a CD, on that CD is a file AutoRun.exe and in a directory called Setup on that cd is Setup.exe. To access the setup.exe from AutoRun.exe you would use the reference ".\Setup\Setup.exe". This means stay in this directory, change to the Setup Directory, run setup.exe

Say you have the same thing but AutoRun is in a a sub directory called AutoRun on the root of the CD. You would access Setup.exe from the AutoRun Directory by using "..\Setup\Setup.exe" This means, change back to the root directory, change to Setup run Setup.exe in that directory.

Lets take it one step further. Lets say AutoRun.exe is in D:\Files\AutoRun\AutoRun.exe. Here you would use "..\..\Setup\Setup.exe" You can continue this in many variety of ways. This one means change back to the Files directory, change back to the root directory, change to the Setup directory, run setup.exe
 

Eagle

aka Alshain
Moderator
Second question, use a webpage control and set the address to the location of the text file.
 

icepir8

Moderator
If you place the readme.txt in the same folder the exe, you can use app.path & "\readme.txt" to open the file.
 

Eagle

aka Alshain
Moderator
icepir8 said:
If you place the readme.txt in the same folder the exe, you can use app.path & "\readme.txt" to open the file.

Oh yeah, that reminds me, "\Setup" is the equivilents of ".\Setup" sometimes, but its safer to use the ".\Setup"

app.path assumes that the file is in the same location as the application. You could say app.path & "..\Setup\Setup.exe"

Imagine the program is in C:\Program Files\MyProg and you want to get to C:\Program Files\YourProg then saying app.path & "..\YourProg\*.exe" would be the same as C:\Program Files\MyProg\..\YourProg\*.exe" meaning it would go back one step and then enter "YourProg".
 
Last edited:
OP
O

Olger901

Banned
Eagle: What command would I use to open up the readme.txt? and what reference or component do I need to add?

Sorry I am totally new to vb6 but Im creating an autorun for my project at
school.

Got another question. If I make the autorun with vb6 will all comps be able to start the autorun then or do they need to have the vb6 runtime files installed



( We needed to make an CD about the Hardware of a comp with videocards, soundcards and all their specifications it is fun. We do this instead of getting normal school lessons :D:D:D) I need to make an autorun that starts an html file (Since that is what our group decided to makle it in) by pressing a button and All the other guys are total n00bs they barely know how Word and Frontpage works. So they asked me to do this

Got another question. If I make the autorun with vb6 will all comps be able to start the autorun then or do they need to have the vb6 runtime files installed
 
OP
O

Olger901

Banned
Could any1 pls answer this question

Will the autorun work on all pcs or do they need to have the vb runtimes installed???
 

Eagle

aka Alshain
Moderator
OK, you need to add the Web Browser Control.

Click Projects -> Components. On the controls tab, check Microsoft Internet controls and hit ok

Double click the world icon to add a web browser control.

The code for this would be

WebBrowser1.Navigate ("c:\readme.txt")

Replace WebBrowser1 with the name you chose, replace the file path with the correct path.

Its very easy this way :) You can put this in whatever method you want, for a command button, put it in the onclick method.
 
Last edited:

nkwaind2000

New member
Hello guys,

I am Derrick.
I have a problem and my problem is as follows:

I designed a calculating program on VB6. I linked my form with MS Word using 'Shell' command. I wish that the results calculated on the form be sent to and displayed inside the word document so that editing can be possible. I am unable to do this. Please anyone who has an idea on how to proceed should help me.
 

Top