CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jul 2011
    Posts
    5

    MY own version of CMD

    Hi i am a noob to VB.NET

    But i am looking to create my own version of CMD ,embedded into my program. Being a noob I dont know where to start. Any advise or tutorials would be greatfull. JUst really looking to be pointed in the right direction.

    Thanks

    Jonathan

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: MY own version of CMD

    Creating your own version of CMD would be quite a task that would for the most part be pretty pointless. As they say no since in trying to re-invent the wheel. You can of course use shell to launch the existing CMD from VB. You could also write a console app that would take input from the user and shell to the given program which would handle a lot of what CMD does but all you would really be doing is provided the user with a different interface CMD would still be doing the work.

    I would advise a different project for learning.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jul 2011
    Posts
    5

    Re: MY own version of CMD

    Thats what i am looking to do just provide a different interface for CMD within my program, but i want it to look like an embedded console.

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: MY own version of CMD

    Look in your help file at the Shell() function
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: MY own version of CMD

    So you want your console to return results?

    Code:
    > ? 2 + 2
    4
    >
    That would be a LOT harder.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Jul 2011
    Posts
    5

    Re: MY own version of CMD

    OK would it be easier to some how embed the cmd into part of my program is that possible.

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: MY own version of CMD

    There is a SCRIPTING engine, that you might be able to call. Of course, then you run into PERMISSION problems on new OS's
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  8. #8
    Join Date
    Jul 2011
    Posts
    5

    Re: MY own version of CMD

    OK what about an interface that looks like CMD but just pass the request to CMD and then displays the results. In effect like a cmd emulator.

  9. #9
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: MY own version of CMD

    Well, One-Note does it, so it *IS* possible. Just type 2 + 2 = and it displays the results below. Terrible security risk, if someone tries DEL *.*
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  10. #10
    Join Date
    Jul 2011
    Posts
    5

    Re: MY own version of CMD

    yes but I am sure that i can put in to place some kind of filter to stop that. And also permissions in place to access the CMD.

  11. #11
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: MY own version of CMD

    The idea is to NOT let the user alter the project, only EXECUTE the code. Pre-program ALL commands that are allowed, and let them enter parameters. That would be better, and you can test to see if it works.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  12. #12
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: MY own version of CMD


  13. #13
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: MY own version of CMD

    Quote Originally Posted by dglienna View Post
    The idea is to NOT let the user alter the project, only EXECUTE the code. Pre-program ALL commands that are allowed, and let them enter parameters. That would be better, and you can test to see if it works.
    This reminds me of my Computer studies day's at school...
    Having the Basic background from the C64, GWBasic was a breeze and i was miles ahead of the rest of the class... I spent two days writing a GWBasic Emulator in GWBasic... and one day before class started i loaded it on ALL the Pc's and started it.. so when class started, everyone thought they were working in GWBasic...

    I wrote all the functions in just like GWbasic, even got most of the error's in.. LOAD would load a project (into my Emulator), code edit's were accepted, and lines sorted accordingly (Those where the days of numbered lines of code), SAVE would save the file as a STD GWBasic project file.. LIST Listed the code...

    However if you tried to RUN your code... ... I had several versions that did different things.. Well they all flushed your code (so it was lost if you did not SAVE)

    #1 : Return a Memory error and wait for next command.. (but you still in emulator)
    #2 : Just freeze up the system....
    #3 : Emulated the Drip virus, and have the letters on screen slowly drip off the screen..
    #4 : Clear the Screen and have a ball bounce around the screen...
    #5 : Report a Syntax Error on the first line, and wait for next command..

    Boy ... those were the day's ...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  14. #14
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: MY own version of CMD

    Fake dialup connection reset. Modem dials, prints two lines, waits for password.

    Had a computer science TEACHER that fell for it once...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  15. #15
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Talking Re: MY own version of CMD

    Quote Originally Posted by GremlinSA View Post
    This reminds me of my Computer studies day's at school...
    Having the Basic background from the C64, GWBasic was a breeze and i was miles ahead of the rest of the class... I spent two days writing a GWBasic Emulator in GWBasic... and one day before class started i loaded it on ALL the Pc's and started it.. so when class started, everyone thought they were working in GWBasic...

    Boy ... those were the day's ...
    Quote Originally Posted by dglienna View Post
    Fake dialup connection reset. Modem dials, prints two lines, waits for password.

    Had a computer science TEACHER that fell for it once...
    Hmm, glad I didn't have you guys in one of classes! LOL!

Page 1 of 2 12 LastLast

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

Featured