473,770 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4852

"Michael Roebuck" <mi**********@n tlworld.com> wrote in message
news:mY******** ***********@new sfe7-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.Diagnos tics.Process.St art'...

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******** ******@TK2MSFTN GP12.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.Diagnos tics.Process.St art'...

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
2561
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 now, a lot more in the future. I think I have a pretty good understanding about how the command pattern is tought to work, however during implementation I'm htting a couple of quite large design considerations that I'm not sure I have the answare...
8
1333
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 newsgroups I learned that there is a function in stdlib.h called system. int system(const char *command); First question, is the system command ANSI compliant. Because I include <cstdlib> and write std::system(command.c_str()); it looks like an...
2
9289
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 reads "Invalid use of null". The remainder of the options in the Command Button Wizard are then unavailable and the button wil not work. The only solution is to log on to a different workstation. Any ideas?
2
6673
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 sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim command As String command = "systeminfo > C:\temp\sysinfo.txt"
34
6877
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: 1) get whole string of input line 2) preset table of strings matching <command> 3) preset table of function calls
13
4514
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 command set consisting of several single letter commands which take no arguments. A few additional single letter commands take arguments:
0
1719
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 Db Private Shared _ConnString As String = "" Private Shared _Connection As SqlConnection Public Shared Sub SetConnectionString(ByVal connString As String)
3
18717
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, working with complex reports is tricky Assumption: Reader of this article have basic knowledge of creating data reports. Creating a Parent-Child Command and create a DataReport Suppose we have a database called company with two tables ...
51
4159
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 Command Prompt or Browser or some other application? Ojas.
0
9602
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9439
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.