Shell and Wait

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Thomas

    #1

    Shell and Wait

    I am using the code posted on the Access Web by Terry Kreft to shell and
    wait for an application to finish before continuing. The application I am
    shelling out to requires that the current directory be changed before it can
    run successfully (because it calls another application using a relative
    path). Can anyone post some advice that I could use to make this work.
    Below is my code and the code from the Module.

    ----------------------------
    My Form Code
    ----------------------------

    strShellPathNam e = Mas_Scr_Hwd & "\PVXWIN32. EXE ..\LAUNCHER\SOT A.INI
    ...\SOA\MAS90 -ARG ..\vi\" & viJobID & " W O DIRECT " & viMode & " " &
    MAS_SCR_CMP
    ShellWait (strShellPathNa me)

    ----------------------------
    End My Form Code
    ----------------------------


    A link to the code by Terry is below. I don't think it would be appropriate
    for me to re-post his code without his permission, but it's available at the
    following website:



    Thanks in advance for any ideas.



  • Terry Kreft

    #2
    Re: Shell and Wait

    Daniel,
    Interestingly I had a similar problem just this year, look at ChDrive and
    ChDir to achieve this before your call to ShellWait.

    Terry


    "Daniel Thomas" <daniel@goochsu pport.com> wrote in message
    news:vr4i5l1e7t 0b15@corp.super news.com...[color=blue]
    > I am using the code posted on the Access Web by Terry Kreft to shell and
    > wait for an application to finish before continuing. The application I am
    > shelling out to requires that the current directory be changed before it[/color]
    can[color=blue]
    > run successfully (because it calls another application using a relative
    > path). Can anyone post some advice that I could use to make this work.
    > Below is my code and the code from the Module.
    >
    > ----------------------------
    > My Form Code
    > ----------------------------
    >
    > strShellPathNam e = Mas_Scr_Hwd & "\PVXWIN32. EXE ..\LAUNCHER\SOT A.INI
    > ..\SOA\MAS90 -ARG ..\vi\" & viJobID & " W O DIRECT " & viMode & " " &
    > MAS_SCR_CMP
    > ShellWait (strShellPathNa me)
    >
    > ----------------------------
    > End My Form Code
    > ----------------------------
    >
    >
    > A link to the code by Terry is below. I don't think it would be[/color]
    appropriate[color=blue]
    > for me to re-post his code without his permission, but it's available at[/color]
    the[color=blue]
    > following website:
    >
    > http://www.mvps.org/access/api/api0004.htm
    >
    > Thanks in advance for any ideas.
    >
    >
    >[/color]


    Comment

    • Bruce M. Thompson

      #3
      Re: Shell and Wait

      Response below.
      [color=blue]
      > I am using the code posted on the Access Web by Terry Kreft to shell and
      > wait for an application to finish before continuing. The application I am
      > shelling out to requires that the current directory be changed before it can
      > run successfully (because it calls another application using a relative
      > path). Can anyone post some advice that I could use to make this work.
      > Below is my code and the code from the Module.
      >
      > ----------------------------
      > My Form Code
      > ----------------------------
      >
      > strShellPathNam e = Mas_Scr_Hwd & "\PVXWIN32. EXE ..\LAUNCHER\SOT A.INI
      > ..\SOA\MAS90 -ARG ..\vi\" & viJobID & " W O DIRECT " & viMode & " " &
      > MAS_SCR_CMP
      > ShellWait (strShellPathNa me)
      >
      > ----------------------------
      > End My Form Code
      > ----------------------------[/color]

      If the "relative path" is based on the location of pvxwin32.exe, then I suppose
      you need to change the directory, prior to issuing the "ShellWait( )" function
      call, using:

      'Ensure correct drive is the current drive
      ChDrive Mas_Scr_Hwd
      'Set current directory on current drive
      ChDir Mas_Scr_Hwd

      This is assuming that "Mas_Scr_Hw d" is a variable holding the path to the
      referenced executable (the assumed baseline for the relative paths). Since I am
      not familiar with the ProvideX software, you will need to refer to your user's
      manual for more information.

      --
      Bruce M. Thompson, Microsoft Access MVP
      bthmpson@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
      >> NO Email Please. Keep all communications[/color][/color]
      within the newsgroups so that all might benefit.<<


      Comment

      Working...