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

VB.Net shell execute with command

Help please

I am trying to execute a shell.exe which requires a command for usage in VB.Net

so the shell is in folder "tmp"
c:\tmp> shell.exe
and then the command follows:
c:\tmp> shell.exe -f "c:\file\to\load" table database

There are of exsamples for just executing a shell but can't seem to come right with shell followed by command.

Regards
Nov 20 '08 #1
4 15731
Plater
7,872 Expert 4TB
If you are trying to start a process, the Process object is the thing to use.
Nov 20 '08 #2
Sounds good but the process requires a command and within the command are required Quotes "" :

I suck at shells, well its my first time doing this so bare with me.My attempt would be:

process.start(shell("c:\PROG.EXE -f "c:\path\to\file" table database"))

Thnkas for comments but more help reuired please.
Nov 21 '08 #3
Solved

Private Sub

Dim stAppName As String

stAppName = "app.exe -f ""C:\path\to\file"" database table"

Call Shell(stAppName, 0)

End Sub

This works perfectly.
Nov 21 '08 #4
Plater
7,872 Expert 4TB
Well I don't see why you had to use old COM objects to do a simple task like that when the Process object is still the correct one to use, but I can't stop every bad VB practice :-)
Nov 21 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Valentine Kouznetsov | last post by:
Hi, simple question, how to execute command in current shell, not in subshell? Example. I have environment variable A=aaa and need to invoke shell (sh) script which will do something with A. If...
2
by: david Wilton | last post by:
Hi all, Does anyone know how to execute command line in ASP? thanks David
1
by: josh | last post by:
anybody know why "edit-and-execute-command" doesn't work in python's readline? it doesn't even show up in a dump of readline functions: $ cat fc_test C-p: dump-functions C-e:...
9
by: Richard Grene | last post by:
What would be the equivalent in vb.net for the following Shell Execute written in C? ShellExecute(NULL, "print", "c:\\filename.doc", NULL, "", SW_HIDE); Thanks, Richard
4
by: nadz | last post by:
hey guys, I know bit of C++. I have installed Microsoft Visual C++ 2005 express. First of all tell me if it is of any use ? My other question is that I am trying to execute this command...
1
by: shubhangi | last post by:
Hi, Please check following code. In below code I don't want to display results of "execute (@sql)", but want @cntA to be displayed. Is there any command to stop display of execute command as per...
2
by: Michael | last post by:
Question. Is it possible to run Server.execute command inside global.asa file. if it is where. Inside Application onstart? Another ideas appreciated. Michael
23
by: ticfranca | last post by:
Hi, I'm getting this error in the code below: sub Pega_recorde { $database = 'bundinha'; $host = 'localhost'; $usuario = 'myhumoradm'; $senha = 'my8xr2d2'; ...
7
by: sonet | last post by:
in perl we can execute command and get result(command line stdout) by $a=`cmdline parameter`; print $a; in c system('cmdline parameter'); but i can not get the result (command line stdout).
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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...
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.