473,394 Members | 1,821 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,394 software developers and data experts.

how to call system command from VB?

jim
Hi all,

I have a very old utility which is DOS command, I want to call it from
VB code. How can I call this from VB? Anyone can help I very
appreciate.

Nov 21 '05 #1
7 7344
In article <11**********************@f14g2000cwb.googlegroups .com>, jim wrote:
Hi all,

I have a very old utility which is DOS command, I want to call it from
VB code. How can I call this from VB? Anyone can help I very
appreciate.


You should be able to use the shell command, or
System.Diagnostics.Process.

--
Tom Shelton [MVP]
Nov 21 '05 #2
To just call it

Shell """c:\Program Files\SomeFile.exe"""

Nov 21 '05 #3
jim
when I use ShellId = Shell(CommandLine, vbNormalFocus)

I got compile error: expected variable or procedure, not module

Nov 21 '05 #4
"jim" <ji*******@gmail.com> schrieb:
I have a very old utility which is DOS command, I want to call it from
VB code. How can I call this from VB? Anyone can help I very
appreciate.


<URL:http://dotnet.mvps.org/dotnet/samples/misc/RedirectConsole.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5
jim
Thanks all very much. I know the problem to use shell. because there is
another module that someone define the name is Shell, so I can't use
shell command.

Thanks everyone again.

Nov 21 '05 #6
"jim" <ji*******@gmail.com> schrieb:
I know the problem to use shell. because there is
another module that someone define the name is Shell, so I can't use
shell command.


Simply use 'Interaction.Shell'...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #7
jim
same error I got as ShellId = Shell(CommandLine, vbNormalFocus)

Nov 21 '05 #8

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

Similar topics

5
by: Ayesha Ahsan | last post by:
Hi, I use Runtime.getRuntime().exec(command) to make my system call. For Windows based Dos, i add "cmd /c" before I type in my system call. So for example make the system call "dir": String...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
8
by: zhiwei wang | last post by:
I remember that there is a function that could invoke shell command such as "rm" "cp", directly in .c file. But I could not recall its name, and I googled with nothing meaningful. I vaguely...
3
by: gmtonyhoyt | last post by:
Okay, this one's a tough one for me to explain so this might take a few e-mails to get the idea across. Here's what I got though. I have this application running on a Sun/Solaris machine,...
10
by: kaci_tizi_ouzou2000 | last post by:
Greetings all. I am trying to make a system call as on WinXP, #include <stdlib.h> int main() { system( "ls -al"); }
0
by: haynes george | last post by:
hi .. I was reading the tutorial "Extending and Embedding the python interpreter" available with python .. http://www.python.org/doc/2.2.3/ext/ext.html As per given in the tutorial i...
1
by: qilin | last post by:
I have perl program which use system() to call another c program meanwhile the c program also use system() to execute a linux command line ....but not sure why it doesn't work. yes, the perl...
9
by: C++ Newbie | last post by:
Hi, Why doesn't the following C++ program echo the value of 97? If you manually "head -3 temp.txt | tail -1" the temp.txt file, you will get 97. Use it in a system call, and it doesn't work. ...
35
by: jleslie48 | last post by:
I've written a cgi program in C using the borland 5.5 free compiler, and it runs just fine on an Apache server. My only issue is if I issue some system calls the cgi suspends until the call...
0
ashitpro
by: ashitpro | last post by:
Writing System Call Wrappers in User Space. Recently I saw a post in Linux/Unix section to know the user who deleted the file in linux. Currently there is nothing in linux which could achieve...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.