Results 1 to 9 of 9

Thread: how can i make autorun CD

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    278

    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

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    278

    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

  4. #4
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    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

  5. #5
    Member
    Join Date
    Aug 2006
    Posts
    51

    Re: how can i make autorun CD

    for somethign more elaborate, there are autorun creation programs, like autoplay media studio.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    278

    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
    Last edited by sajankk; May 14th, 2008 at 01:10 AM.

  7. #7
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    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

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  9. #9
    New Member
    Join Date
    Jun 2008
    Posts
    1

    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???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width