Well at least in the watch window the correct syntax seems to be this code:
Shell(lblMameExePath.Text & " -listinfo >" & """" & Application.StartupPath
& "\Games.cfg" & """", AppWinStyle.NormalFocus, True)
Here is what it displays in the watch window:
Watch string:
lblMameExePath.Text & " -listinfo >" & """" & Application.StartupPath &
"\MameGames.cfg" & """"
String Value:
"C:\Mame\Mame.exe -listinfo >"C:\VB Projects\XLM
App\Writer\bin\MameGames.cfg""
If you remove the beginning and end quotes because it is a string it is the
exact syntax I need. From a command prompt it works great. However, from
within the code it does nothing.
Ken I also tried your code and it too looked correct in the watch window but
failed to create the file. Both of our syntax's go through the motions. It
takes about 60 seconds to create. It is a 20MB text file. However, after
execution, no file appears. I have searched my entire harddrive and NOTHING.
I'm stumped. The tought thing is that it will still scroll all the text to
the screen if the path is bad so I can't really tell whether its writing a
file or just outputting to the screen. Any more ideas?
The next thing after I get this working will be to create the file the first
time during the install routine. I'm not quite sure how to do this either,
but haven't looked into it yet.
Thank you,
John
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j*************@uni-berlin.de...
* "jcrouse" <me> scripsit: I am trying to run a command from a command prompt using the shell
command. Here is the syntax I want to execute:
Shell(lblMameExePath.Text & " -listinfo >" & Application.StartupPath &
"\MameGames.cfg", AppWinStyle.NormalFocus, True)
The problem is that the parameter Application.StartupPath has spaces
(C:\Program Files, for instance) and won't execute from a command prompt
without being incased in quotes. I can't figure out the proper syntax
with my quotes.
\\\
Shell(lblMameExePath.Text & " -listinfo >""" & Application.StartupPath &
"\MameGames.cfg""", AppWinStyle.NormalFocus, True) ///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>