Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9305085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:51:05+00:00 2026-06-18T23:51:05+00:00

I recently learned how to use VB.NET to set your program as the default

  • 0

I recently learned how to use VB.NET to set your program as the default for a chosen extension. You would write code to set a registry value. The problem is, when you open the file – after setting your program as default – it just opens your program (like a shortcut would). Is there a way that you could make it actually open the file? So say I have a text file. I set the default program for .txt files to my application. How would I make it load the text file, when I click to open the file, like you can if notepad is set to the default? If this doesn’t make sense, just let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T23:51:07+00:00Added an answer on June 18, 2026 at 11:51 pm

    The path to the file is passed to your program as a command line parameter. Your program will need to read the command line parameters and react accordingly.

    Here is some example code demonstrating how to read the command line parameters:

      Sub Main()
        Dim s() As String = System.Environment.GetCommandLineArgs()
        ' write code to open the file here...
        Console.WriteLine(s(1))
      End Sub
    

    To help with debugging this you can specify command-line arguments in the Visual Studio IDE:

    1. With a project selected in Solution Explorer, on the Project menu, click Properties.
    2. Click the Debug tab.
    3. In the Command line arguments field, enter the command-line arguments you wish to use.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently learned about IKVM.net which is a Java for Mono (.NET). So I
I recently learned how to use automake, and I'm somewhat annoyed that my compile
I recently learned about CTE's in SQL Server and am attempting to use it
I've recently learned to write my own WebControls, but I'm still hazy on the
I recently learned of the IIF(A,B,C) function. I'm a long time VB/VB.NET Coder who
Introduction Hello folks, I recently learned to program in C! (This was a huge
I recently learned that JIT compilers are used to compile platform independant code to
I'm recently have learned to use Zend Framework. I did a simple CRUD application.
I recently learned about the DI frameworks Guice and Ninject and wanted to use
I just recently learned about self calling anonymous functions. Some snippets of code that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.