Jump to content
xisto Community
Sign in to follow this  
web_designer

What Is Shell And How To Use It?

Recommended Posts

hi, i am new to vb.net. i am still learning. i have question about shell, i use visual studio 2008- visual basic .net. when i wanted to run a command in sell. i couldn't know to to run that command and where to write it. when i made a quick search on the net all i could understand that i should write the command in notepads editor and save it as batch file.all i wanted to do is writing command in shell so i can make my name appears in dos prompt. that is mean passing parameters and display them on dos, thank yo in advance.

Share this post


Link to post
Share on other sites

I think shell is simply microsoft talk for terminal, or DOS. But im not 100% on that.try googling "batch files handling parameters" and see what turns up. It should set you on the right path i think. Batch files dont involve VB.net though, batch files are just a list of commands that are executed as a group, or "batch" hence the name.Shell, i think, in a VB sense is simply their way of invoking command prompt commands using a dos emulator which they term shell. Im not sure but try the batch file google and see if that is what you are after.

Share this post


Link to post
Share on other sites

Shell is terminal or DOS in windows or the command prompt i think? some use this for some specific reasonsyou can change the permissions to hide, read only, archive and also if you don't have OS you can use the DOS tonavigate or explore your PC by just using it.Some programming lang, like C or C++ use DOS I think JAVA also?

Share this post


Link to post
Share on other sites

Everything was first used in linux as it pre-dates the "windows" we use today. However i would guess that in nix it was called Terminal as it still is today.And it certainly does give much, much greater control over the system. The graphical interface has only certain features that the developers choose to give access to. The rest of the features and options are accessed via the Terminal, shell or com-prompt. This is mainly because users are simply not experienced enough to mess with the more advanced options so they are hidden behind a sort of "test" whereby if you are experienced enough to use the terminal then you are experienced enough to know the consequences!

Share this post


Link to post
Share on other sites

To put it in geek terms, a shell is the interface between the user and...hmm whatever the user is connecting to. It's just a place to dish out your commands, and you will never get any graphical interface within a shell. But programmers say shell access gives you greater control and power to do whatever you want. I prefer the graphical interface, even though its functionality is limited. And I think shell was first used in UNIX if I'm not wrong?

Share this post


Link to post
Share on other sites

these are great help, thank you. but i still didn't get it . how to open shell window from visual basic.net and should i write the shell commands. i tried searching the net about "batch files handling parameters" but i didn't find something useful. if anyone can show me how to open shell in visual basic.net and where to write codes i will be appreciated.

Share this post


Link to post
Share on other sites

if anyone can show me how to open shell in visual basic.net and where to write codes i will be appreciated.

You write them using a normal text editor, save as ".bat"-files and then run. Running with visual basic... well, you just give the command to run the script I guess, I'm not sure I don't know VB

Share this post


Link to post
Share on other sites

you really need to be more specific in what you want visual basic to do. just open up a command prompt? then it would be something like...

Private Sub CallApp()
Call Shell("C:\WINDOWS\system32\cmd.exe", 1)
End Sub

and to have your name appear in the window, you would have to write a small "bat" file. something like...

@echo off
echo Hello "name"
pause

i put a pause there only because i know if you just run a bat file directly, the window will close after the whole file has been run. so pausing it allows you to see your name.

i am unfamiliar with vb.net, but i googled it and came up with this code here....

using System;namespace Learn{class cmdShell{[STAThread]static void Main(string[] args){Declare New ProcessSystem.Diagnostics.Process proc;Run test.bat from command line.proc = System.Diagnostics.Process.Start("C:\\test.bat");Waits for the process to end.proc.WaitForExit();}}}

so then all you need to do after you have this code to execute the .bat file is to create the bat file itself and make sure you point to the right directory and subdirectory where your .bat file is saved you write your .bat files in your text editor....usually just in note pad and make sure you save it as a .bat file and not a .txt file


these are great help, thank you. but i still didn't get it . how to open shell window from visual basic.net and should i write the shell commands. i tried searching the net about "batch files handling parameters" but i didn't find something useful. if anyone can show me how to open shell in visual basic.net and where to write codes i will be appreciated.

Share this post


Link to post
Share on other sites

Hi!As HOD mentions above, a shell is simple a user interface that has been built around an operating system. You can refer to the command prompt as a shell, which is a text-based interface. However, the graphical user interface that Windows provides is also a shell (we can call it a graphical shell, to avoid confusion). Shell programming, when referring to Linux scripting, usually refers to using the bash shell, C shell, or any other interface. The equivalent in the DOS and Windows world are batch files, which are simple text files with commands where you can use some additional notation, such as to indicate parameters. You can also execute commands that you would normally type at the command prompt from within Visual Basic, which is what anwii is referring to. Since you're mentioning about Visual Basic, I'm guessing that you might even be referring to the ability to add menu items to the context (right-click) menu that you get when you click on a file (For example, the "Edit with Notepad++" menu item when you right click on just about any file).As you can tell, "shell programming" is a very vague term that one can easily take out of the context that you intended :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.