PC Review


Reply
Thread Tools Rate Thread

how to call system command from VB?

 
 
jim
Guest
Posts: n/a
 
      9th Aug 2005
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.

 
Reply With Quote
 
 
 
 
Tom Shelton
Guest
Posts: n/a
 
      9th Aug 2005
In article <(E-Mail Removed)>, 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]
 
Reply With Quote
 
Markis Taylor
Guest
Posts: n/a
 
      9th Aug 2005
To just call it

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

 
Reply With Quote
 
jim
Guest
Posts: n/a
 
      9th Aug 2005
when I use ShellId = Shell(CommandLine, vbNormalFocus)

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

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Aug 2005
"jim" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
jim
Guest
Posts: n/a
 
      9th Aug 2005
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.

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Aug 2005
"jim" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
jim
Guest
Posts: n/a
 
      9th Aug 2005
same error I got as ShellId = Shell(CommandLine, vbNormalFocus)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
call command klp via AccessMonster.com Microsoft Access Macros 1 6th Mar 2007 10:09 PM
Call vs. Run command Chris McFarland Microsoft Excel Programming 1 21st Jun 2004 04:10 PM
system reboots NT authority/system remote procedure call What to do? =?Utf-8?B?aG91c2U=?= Windows XP Help 4 24th Feb 2004 07:06 AM
Be able to call the dos run command SK Windows XP Internet Explorer 0 13th Jan 2004 04:26 PM
System Shut Down, Repeatedly: NT AUTHORITY/SYSTEM -Caused by Remote Procedure Call service =?Utf-8?B?Q2xhcmVuY2U=?= Windows XP Help 1 20th Dec 2003 04:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:10 PM.