|
-
February 6th, 2011, 11:01 PM
#1
executing shell commands from string
how can i execute a shell command from a string
what im trying todo is this
shell("cd", StringName)
the string comes from a user entered textbox
StringName = Textbox.text
how can i get this to work?
-
February 7th, 2011, 05:25 AM
#2
Re: executing shell commands from string
You write the complete command to a .bat file, and use shell("batfile.bat")
-
February 7th, 2011, 10:42 AM
#3
Re: executing shell commands from string
 Originally Posted by mavy-online
You write the complete command to a .bat file, and use shell("batfile.bat")
i have explored this option but how do i pass along the directory the user entered in the text box?
i am using visual studio 2010
-
February 7th, 2011, 12:14 PM
#4
Re: executing shell commands from string
what im trying todo is this
Doesn't make any sense. You want a shell to CD?
-
February 7th, 2011, 12:39 PM
#5
Re: executing shell commands from string
 Originally Posted by cm0002
i have explored this option but how do i pass along the directory the user entered in the text box?
i am using visual studio 2010
You concatenate your command of choice with everything in the textbox.
dim batfile as string = "cd " & textBox1.Text
-
February 8th, 2011, 07:25 AM
#6
Re: executing shell commands from string
Of course there is no point using shell at all if the goal is to change the directory as this can easily be done within the program.
Always use [code][/code] tags when posting code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|