Results 1 to 7 of 7

Thread: [RESOLVED] how to make no gui application?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    [RESOLVED] how to make no gui application?

    Thats the very basic thing & there should be like a template for this & after searching google & VBhelp file for like 3 hours I still cant find how to do it.

    Let me get to point:

    I want execute exe, it will decompress a file & exit.

    I have code, it works. but the CMD console window keeps popping out every time I launch my exe.

    Im a beginner, so explain for beginner please.

    How can I make No gui application? Im using vb 2008 express

    PHP Code:
    Imports System
    Imports System
    .Collections.Generic
    Imports System
    .IO
    Imports System
    .IO.Compression

    Module Module1

        Sub Main
    ()
            
    UncompressFile("1.gz")
        
    End Sub

        
    Public Sub UncompressFile(ByVal file)
            
    'do stuff hire
        End Sub
    End module 
    Last edited by goldenix; Mar 9th, 2010 at 10:42 AM.

    M.V.B. 2008 Express Edition

  2. #2
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Re: how to make no gui application?

    If the CMD console windows pops out, its because you built a command line application, therefore it IS a no GUI application.

    The CMD console is not a GUI (Graphical User Interface).

    The only way I see, if you don't want anything to appear on the screen would be to create a windows form application and Hide it immediately.

    vb.net Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    4.         Me.Hide()
    5.                 'Do what ever you need to do here.
    6.         Me.Close()
    7.     End Sub
    8. End Class
    Last edited by stlaural; Mar 9th, 2010 at 10:24 AM.
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

  3. #3
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: how to make no gui application?

    Just a guess...

    What happens if you execute it like this?
    myfile.exe > null
    or
    myfile.exe > C:\temp.txt
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    Re: how to make no gui application?

    Quote Originally Posted by Pradeep1210 View Post
    Just a guess...

    What happens if you execute it like this?
    myfile.exe > null
    or
    myfile.exe > C:\temp.txt
    I have no clue what do you mean? And not going to make a program to just execute it sry. im really pissed at vb right now.

    @stlaural
    Omfg and its as simple as that. No more annoying console window. Thank you.

    M.V.B. 2008 Express Edition

  5. #5
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Re: [RESOLVED] how to make no gui application?

    Its not a perfect solution though, it works but its definitly not a perfect solution.
    Still, if it does what you need it to do...
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

  6. #6
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: [RESOLVED] how to make no gui application?

    ok.. Please ignore my previous answer. I got your requirements wrong. I guess you want to double click and run your console application without any command prompt window appearing.

    This is how you would run your console application without showing the command prompt window:

    Just open your project properties and set the Application type to "Windows Forms Application". Rebuild and run your application. Now it should run without showing the command prompt window.

    Name:  console-app-with-no-cmd-prompt.JPG
Views: 3705
Size:  34.3 KB
    Last edited by Pradeep1210; Mar 10th, 2010 at 10:15 AM. Reason: corrected a typo
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  7. #7
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Re: [RESOLVED] how to make no gui application?

    That is clearly a more elegant way to do it.
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

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