469,323 Members | 1,574 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

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 15391
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

Post your reply

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

Similar topics

1 post views Thread by Valentine Kouznetsov | last post: by
2 posts views Thread by david Wilton | last post: by
1 post views Thread by josh | last post: by
9 posts views Thread by Richard Grene | last post: by
4 posts views Thread by nadz | last post: by
7 posts views Thread by sonet | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.