Results 1 to 6 of 6

Thread: in VS 2008, can I execute a non-project file?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2012
    Posts
    122

    in VS 2008, can I execute a non-project file?

    HI -- I have vs 2008. I have a VB project with lots of stuff. I want to do a little program to test out some ideas. I also, separately, want to execute a little .cmd script.

    What I would like, is a way to execute my little test program, or the little .cmd script directly from within VS, bypassing the debug information set up for the project.

    Is this possible? If so, how? If not, are there good workarounds?

  2. #2
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: in VS 2008, can I execute a non-project file?

    You can use process.start(.....) for that


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2012
    Posts
    122

    Re: in VS 2008, can I execute a non-project file?

    OK -- please excuse my noobie questions! Could you elaborate a little? e.g. I'm sitting looking at my vs session. The file I'm editing is a cmd file with some typical command line commands. I would like to tell vs, "Run this file in the directory where it lives, please" (or any other directory for that matter.)

    I think I need step-by-step instructions.

  4. #4
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: in VS 2008, can I execute a non-project file?

    No hard feelings, but you don't need step-by-step instructions to Google.
    If you'd search for "process.start vb.net" you will find something like:
    system.diagnostic.process.start("yourfile.txt")
    Its really not that hard, but you need to work for your questions instead of simply asking and waiting for a complete answer. Means that people will ask you what you already have (in code). Only if you're totally stuck some people will help you completely.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2012
    Posts
    122

    Re: in VS 2008, can I execute a non-project file?

    Yes, I found that. What I don't get is how to get that line to actually execute on its own. e.g. If I just hit F5, VS starts running according to the instructions in the project file and the little dropdown menu with "Release" and "Debug" in it. However, I want VS to ignore those instructions and just run what I'm looking at. That's the piece I seem to be missing.

    Sort of an ad-hoc run this stuff now and only this.

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: in VS 2008, can I execute a non-project file?

    I keep a test project around for times like that. If I wanted to deal with one code page, I'd open the testApp, and use the Project|Add Exisiting Item to add that page into the TestApp, then add a call to whatever method I wanted to test as the click event of a button on one of the TestApp forms.
    My usual boring signature: Nothing

Tags for this Thread

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