473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Run a DOS command

Hi all

I'm very new to VB - I am trying to run a DOS command from within a VB2005
asp.net web site using a command button?

The DOS command will take the form of the command followed by several
switches!

Any ideas examples gratefully accepted.

P.S. If this is the wrong group please accept my apologies (and let me know
where to post).

Thanks in advance
Mar 2 '06 #1
3 4814

"Michael Roebuck" <mi**********@ntlworld.com> wrote in message
news:mY*******************@newsfe7-win.ntli.net...
I'm very new to VB - I am trying to run a DOS command from within a VB2005
asp.net web site using a command button?

The DOS command will take the form of the command followed by several
switches!


SHELL doesn't work from there?

Mar 2 '06 #2
"Homer J Simpson" <no****@nowhere.com> schrieb:
I'm very new to VB - I am trying to run a DOS command from within a
VB2005 asp.net web site using a command button?

The DOS command will take the form of the command followed by several
switches!


SHELL doesn't work from there?


.... or 'System.Diagnostics.Process.Start'...

Note that some commands are actually part of the command shell "cmd.exe"
(environment variable 'comspec'). Thus it's necessary to call "cmd.exe"
instead of the command and pass the command as an argument
('Process.Start("cmd", "bla")').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 2 '06 #3
CMM
More precisely: Process.Start("cmd.exe", "/C <command> <switches and
parameters>").

Change /C to /K to keep the command prompt window around after the command
finishes.

--
-C. Moya
www.cmoya.com
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Oa**************@TK2MSFTNGP12.phx.gbl...
"Homer J Simpson" <no****@nowhere.com> schrieb:
I'm very new to VB - I am trying to run a DOS command from within a
VB2005 asp.net web site using a command button?

The DOS command will take the form of the command followed by several
switches!


SHELL doesn't work from there?


... or 'System.Diagnostics.Process.Start'...

Note that some commands are actually part of the command shell "cmd.exe"
(environment variable 'comspec'). Thus it's necessary to call "cmd.exe"
instead of the command and pass the command as an argument
('Process.Start("cmd", "bla")').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: TEK | last post by:
Hello I'm wondering if anyone out there might give some input/suggestions/viewpoints around the Command pattern. In my case, the number one priority for using the pattern is undo support. Some...
8
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
2
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which...
2
by: micahstrasser | last post by:
I have been trying for days to send a command to the command prompt through the shell() function in vb.net. For some reason it is not working. Here is the code: Private Sub Button1_Click(ByVal...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
0
by: czerwww | last post by:
Can someone please help me? I have class for database connection and I need set command.commandTimeout. How can I do that? Code: Imports System.Data.SqlClient Imports System.Data Public Class...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.