Home All Groups Group Topic Archive Search About

trying to execute a simple command line, need help

Author
30 Jun 2006 1:28 AM
CP11
Newbie here.

I am used to using vbscript but trying vb.net in vs2003.

I am trying to add a button click event, like this:

        Dim LaunchApp As Integer
        LaunchApp = Shell("""c:\program files\myapp\bin\newapp.exe""
/cmdline http://myapps/file.asp /logon")
        AppActivate(LaunchApp)

This variable works like a champ in vbscript but I can't figure out why
nothing happens with the button click, there is no error, but nothing
comes up. Ideas?

Author
30 Jun 2006 5:16 AM
Cor Ligthert [MVP]
CP11,

I don't know either but this newsgroup is full of this kind of code.

\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.arguments = "c:\windows\win.ini"
pi.FileName = "notepad.exe"
p.startinfo = pi
p.Start()
////

I hope this helps,

Cor


Show quoteHide quote
"CP11" <chrispar***@gmail.com> schreef in bericht
news:1151630896.607431.268250@d56g2000cwd.googlegroups.com...
> Newbie here.
>
> I am used to using vbscript but trying vb.net in vs2003.
>
> I am trying to add a button click event, like this:
>
>        Dim LaunchApp As Integer
>        LaunchApp = Shell("""c:\program files\myapp\bin\newapp.exe""
> /cmdline http://myapps/file.asp /logon")
>        AppActivate(LaunchApp)
>
> This variable works like a champ in vbscript but I can't figure out why
> nothing happens with the button click, there is no error, but nothing
> comes up. Ideas?
>
Author
30 Jun 2006 9:02 AM
Herfried K. Wagner [MVP]
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> schrieb:
> I don't know either but this newsgroup is full of this kind of code.
>
> \\\
> Dim p As New Process
> Dim pi As New ProcessStartInfo
> pi.arguments = "c:\windows\win.ini"
> pi.FileName = "notepad.exe"
> p.startinfo = pi
> p.Start()
> ////

.... or even shorter:

\\\
Process.Start("notepad.exe", "C:\WINDOWS\WIN.INI")
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>