Re: Using Shell command

From: Wayne Morgan (comprev_gothroughthenewsgroup_at_hotmail.com)
Date: 01/27/05


Date: Thu, 27 Jan 2005 14:17:25 -0600


>From what I've been able to tell, Shell doesn't like Start. I tried the
following command line and it worked.

Shell "command.com /c c:\windows\system32\mspaint.exe ""C:\Documents and
Settings\Wayne\Desktop\SRU2.jpg"""

Single quotes wouldn't work, Paint didn't like them, so I had to double up
the double quotes. The vbmaximizedfocus works on the command window, not the
program that is opening to display the picture, so I would recommend
dropping it off. Of course, since Start doesn't work and you need to specify
a program, then you could skip command.com all together and just specify the
program, then vbmaximizedfocus would work properly.

Actually, I don't know if it is Shell that doesn't like Start or Start that
doesn't like the command line. I just did some testing with Start by typing
directly into a command prompt. If I used quotes around the command line,
Start would just open another command window with the item in quotes as the
title of the window. If I didn't use quotes, then it didn't like the spaces
in the path to the file.

The problem is Start's parameters:

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/WAIT] [/B] [command/program]
      [parameters]

Note the first parameter. The way I got around this was to go:

Start "" "C:\Documents and Settings\Wayne\Desktop\SRU2.jpg"

Then it would start the program.

Even after that though, I still couldn't get Start to work with Shell. It
won't work without command.com, because Shell expects to see an executable
in the command line and it wouldn't work with it, it just gave what you
indicate. I also tried cmd.exe instead of command.com and the command window
stayed open, but still no picture program.

What would probably work better would be an api call to launch or find the
default program.

This link should show how to launch the default program.
http://www.mvps.org/access/api/api0018.htm
This link should show how to find the default program so that you could then
use it in your Shell statement.
http://www.mvps.org/access/api/api0023.htm

-- 
Wayne Morgan
MS Access MVP
"Rick" <rhess@ullico.com> wrote in message 
news:177f01c50496$750d5260$a601280a@phx.gbl...
> I'm currently working second hand on a application that
> has an image on a form. User wants to be able to double
> click on image open full size window with image.
>
> I've used Shell command.com /cStart "photo path",
> vbmaximizedfocus
>
> This opens a window but it immediately closes.
> Are there any parameters that will keep it open until
> user decides to close it or even another way to
> accomplish same goal.
>
> Any help greatly appreciated.
>
> Thanks,
>
> Rick 


Relevant Pages

  • Re: Bash commands: maybe they want to drive us crazy?
    ... Bill Unruh wrote: ... single quotes would cause the find command to expand the * ... Which means that a shell command and the shell itself are two very different ...
    (comp.os.linux.misc)
  • Re: Bash commands: maybe they want to drive us crazy?
    ... > Bill Unruh wrote: ... > single quotes would cause the find command to expand the * ... > Which means that a shell command and the shell itself are two very different ...
    (comp.os.linux.misc)
  • Re: Background subprocess help?
    ... This description does not correspond to the command above. ... command is confusing because it uses quotes in a strange way. ... meant at the linguistic level and the inner quotes are shell quotes. ... d> processes and/or callbacks and 50+ lines of python code. ...
    (comp.lang.python)
  • Re: Bash commands: maybe they want to drive us crazy?
    ... > single quotes would cause the find command to expand the * ... > The shell seems to expect a command inside back quotes (or back ticks, ... the single quotes turns the shell into parrot. ...
    (comp.os.linux.misc)
  • Re: Using Shell command
    ... >following command line and it worked. ... I don't know if it is Shell that doesn't like ... >Start would just open another command window with the ... >> This opens a window but it immediately closes. ...
    (microsoft.public.access.modulesdaovba)

Loading