how can i make autorun CD
hi all,
It is a general question.. not VB based
I made my office document in a single pdf file. Now i can access all my document through single pdf file. I want to present the same to my boss in CD. Immediately after inserting the CD it has to run. i made autorun.inf file and in that i mentioned
[autorun]
open=filename.pdf
and both .inf and .pdf files stored in the root directory of the CD. But its giving an error that " D:\ is not a valid win32 Application"
Is it possible to make autorun CD anyway to automatically open this .pdf file
Thanks in advance and sorry for posting here in the VB forum
saj
Re: how can i make autorun CD
Thread moved to General Developer forum - we have multiple forums here, please do not pick one that you know is wrong
Re: how can i make autorun CD
Quote:
Originally Posted by si_the_geek
Thread moved to General Developer forum - we have multiple forums here, please do not pick one that you know is wrong
sorry si....
actually i have to get the reply little early...
can u pleases tell how to go about
Re: how can i make autorun CD
"filename.pdf" isn't an executable and thats what it expects.
I would try creating an executable that uses ShellExecute, using that API you can tell it to "open" a "filename.pdf" and it will launch the program that is associated with .PDF files and open the file for you with one line of code.
In VB6 the code is like,
ShellExecute Me.Hwnd, "open","filename.pdf", vbNullString, vbNullString, SW_SHOW)
see ShellExecute Function for more
Re: how can i make autorun CD
for somethign more elaborate, there are autorun creation programs, like autoplay media studio.
Re: how can i make autorun CD
Quote:
Originally Posted by Edgemeal
"filename.pdf" isn't an executable and thats what it expects.
I would try creating an executable that uses ShellExecute, using that API you can tell it to "open" a "filename.pdf" and it will launch the program that is associated with .PDF files and open the file for you with one line of code.
In VB6 the code is like,
ShellExecute Me.Hwnd, "open","filename.pdf", vbNullString, vbNullString, SW_SHOW)
see ShellExecute Function for more
thanku... i made an autorun.inf file and in the file i wrote,
[autorun]
open=autor.exe 'made in vb with shellExecute
icon = autor.exe
i burn the CD with inf, .exe and .pdf in the root directory. its working when i insert the CD second time. first time just i can see acrobat coming and going. i changed SW_SHOWNORMAL still the same problem. please advise me
saj
Re: how can i make autorun CD
Been awhile since I did any of this but I do have an autorun on one of my flash drives, I chagned the VB code to open a PDF file and seems to work just fine on the first try. My INF file is a bit different...
' INF File
Code:
[autorun]
ShellExecute=Autorun.exe
Icon=Autorun.exe,0
UseAutoPlay=1
' VB6 code (Autorun.exe)
Code:
Private Sub Form_Load()
Dim x As Long
x = ShellExecute(Me.hwnd, "open", "r09143v-1.pdf", vbNullString, vbNullString, 1)
Unload Me
End Sub
Re: how can i make autorun CD
Use a batch file instead. You can say
Code:
@start r091blahblah.pdf
In the .bat file. The user doesn't need the VB6 runtimes to run it then. It'll work on Windows machines only though, not sure how you'd do this on a Linux OS.
Re: how can i make autorun CD
I want to pass .net version as parameter in .inf file and check whether the framework is installed on the machine.
ex.
[autorun]
OPEN=autorun.exe v2.0.50727
it should check availability of .Net 2.0.
Can I do it using shellExecute? If not.. Any suggestion???