Results 1 to 11 of 11

Thread: [RESOLVED] About Autorun [Next level]

  1. #1

    Thread Starter
    Member lex_ph's Avatar
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    37

    Resolved [RESOLVED] About Autorun [Next level]

    Ok, I know now how to make CD autorun a certain file.

    VB Code:
    1. [autorun]
    2. open=myapp.exe
    3. icon=myicon.ico

    Now, the next level I want to know is that, how do I make a program in VB6 that runs a certain file in the CD. Say for example, I want to run SetupMenu.exe located in the CD? This SetupMenu.exe is the menu of the files that needed to be installed from the CD. I want to do this because last year (december) I made a BINGO program in VB6 that, and packaged it. I used MS Agent control and i wanted to include the installer of the files needed to run ms agent properly, which is included in cd under "MS Agent" folder. How do I do this? Thank you in advance. (Be back later, I have school. )

    Happy New Year to all!~~~
    -Lex
    Last edited by lex_ph; Jan 2nd, 2007 at 08:27 PM.

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: About Autorun [Next level]

    If the VB program is going to be in the main folder and the SetupMenu.exe is going to be in another folder
    D:\ CD Drive
    ---SetUpMenu Folder
    ------SetupMenu.exe
    ---You VB6 Program

    Then you can use shell to open the program
    VB Code:
    1. Shell App.Path & "\Directory to the other Exe\ExeName.exe"
    Last edited by Andrew G; Jan 2nd, 2007 at 08:51 PM. Reason: Darn Typos

  3. #3
    Hyperactive Member BillGeek's Avatar
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    440

    Re: About Autorun [Next level]

    Remember that a VB6 program will not execute on computers running Windows 2000 or older due to missing runtime libraries. I think that the VB6 runtime libraries were only distributed from Win XP and later...

    What will happen if the user has Win 2000 or older, he will get an error when inserting the CD.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: About Autorun [Next level]

    You can add the runtime files to the CD in the same location as the exe and it will run your VB 6 program from CD.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: About Autorun [Next level]

    If you add the redistributable VB 6 runtime files then you are within licensing rules.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Member lex_ph's Avatar
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    37

    Re: About Autorun [Next level]

    ok i will try these. thanks for the help, be back for updates

  8. #8

    Thread Starter
    Member lex_ph's Avatar
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    37

    Re: About Autorun [Next level]

    question? what do i include in the code if i want to just browse the CD contents?

    VB Code:
    1. Private Sub cmdButton_Click(Index As Integer)
    2. Select Case Index
    3.     Case 0 'bingo main
    4.         Shell App.Path & "\Bingo.Files\CpE.Bingo\Setup.exe"
    5.     Case 1 'robby
    6.         Shell App.Path & "\Bingo.Files\MS.Agent\Robby.exe"
    7.     Case 2 'tts engine
    8.         Shell App.Path & "\Bingo.Files\MS.Agent\tv_enua.exe"
    9.     Case 3 'sapi 4.0
    10.         Shell App.Path & "\Bingo.Files\MS.Agent\spchapi.exe"
    11.     Case 4 'browse cd
    12.         [color=red]????[/color]
    13. End Sub

  9. #9

    Thread Starter
    Member lex_ph's Avatar
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    37

    Re: About Autorun [Next level]

    ok, i just found out the solution to my problem, i just wanted some explanation about the code.

    VB Code:
    1. ...
    2.  
    3. Case 4 'browse CD
    4.    CurrentDirectory = Left(App.Path, 3)
    5.    Shell "explorer " & CurrentDirectory, vbMaximizedFocus
    6. ...

    what are these for? especially the "Left(App.Path, 3)" and the "explorer " part. What are the other 'stuff' aside from "explorer " that i can call? thanks~~~

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: About Autorun [Next level]

    CurrentDirectory = Left(App.Path, 3)

    Its getting the first 3 characters of the path which will be the drive letter of the CDROM drive that your ap is located on if its on a CD.

    Then the Shell line is starting an instance of Explorer set to the path of the CDROM root drive. It will open maximized to the location of the app.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    Member lex_ph's Avatar
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    37

    Re: About Autorun [Next level]

    ok now i get it. i am learning a lot from you guys~~ thank you very much.. this thread is now RESOLVED~~~

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