Results 1 to 4 of 4

Thread: autorun.inf from a CD to start Excel

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Boston
    Posts
    1

    Question

    Hello out there.
    Question on how to get my Excel-based app to run immediately on putting the CD in the drive.

    I gather from the MSDN knowledge base that I have to use 'ShellExecuteEx' in my autorun.inf file on the CD to automatically open Excel and my file, but I'm having a lot of trouble understanding the syntax.

    Can anyone provide a concrete example of what the actual code would look like to run this? This is what MSDN shows:

    ***
    BOOL ShellExecuteEx(
    LPSHELLEXECUTEINFO lpExecInfo
    );

    Parameters
    lpExecInfo
    Address of a SHELLEXECUTEINFO structure that contains and receives information about the application being executed.
    ***

    But I have no idea what to do about "SHELLEXECUTEINFO".

    Damn! Stranded!

  2. #2
    New Member
    Join Date
    May 2000
    Posts
    11
    if I understand correctly you want to launch a *.xls file in your CD-ROM when you insert the CD. This might not be the best way but it works...the user might need to have vb6000.dll, which is not included in W95/NT4 I believe.

    creat an excutable (run.exe) from this code:
    --------------------------------------------------
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    Private Sub Form_Load()
    Call ShellExecute(0&, vbNullString, "c:\testingit\excel.xls", vbNullString, vbNullString, vbNormalFocus)
    Unload Me
    End Sub
    ---------------------------------------------------

    Now in your autorun.inf place this as your first line
    -----------------------------------------------------
    open=run.exe


    hope this helps...all files must be in the root dir...unless otherwise specied by "open=dir\exec"


  3. #3
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    ok, from what's above, I found out that Mark is talking about C++, or Java, and the other person, is talking about Visual Basic

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Angry

    I'm not talking about C++ or Java

    http://msdn.microsoft.com/library/ps...oplay_cmds.htm is a list of commands you can use in autorun.inf files

    Simple as that!

    Mark
    -------------------

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