Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Shell call in VB STUDIO not working properly. (Advanced)?

I have a DOS based EXE that i'm trying to call. When I open the EXE through explorer, Run on the Start menu It opens the EXE with some text asking the user for a year. If i create an access form and make the shell call to the EXE from inside VBA the EXE opens fine, If i use the SHELL call in VB Studio it opens the EXE without any text. the programs default is a grey background instead of the usual black, so i know it's opening the EXE but all i see is the grey background and no text. Why does it work in VBA but not VB studio???? are they different shell commands? is there a library i must referenece?

Update:

When I used VBA I used just a basic Shell call: Shell(FullPath)

I'm using Vb.Net 3.5 framework with Studio 2008 Pro.

In the .Net code I tried the Shell

Shell( "Path" , Appwinstyle.NormalFocus, True, 1000)

So that it has some time to load, if I take out the time it does the same thing. Also tried using the process class and the

AppActivate(Myprocess.ProcessName)

Still nothing.

Update 2:

It turns out that the shell didn't work because it was openeing in the directory where the VB files and exe is stored. It needed to be forced to the C drive in order to properly open the exe i was giving it. (even though my exe path was the full path)

It ended up looking like this:

Shell("cmd /C call \FolderName\" & ProgramNameVariable

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    did you use something like Shell(sstring, vbMaximizedFocus)? Are you using vb or vb.net?

    I found this. See if it will work.

    Dim s As Process

    s.Start("cmd.exe")

Still have questions? Get your answers by asking now.