Problem with Shell Command in VB 5.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Blo

    Problem with Shell Command in VB 5.0

    I have this line in my code that spits out (run time error 53, file
    not found).
    Running this program (project.exe) works fine if I do it through the
    command prompt or Run dialogue box on the Windows XP start menu, but
    not when using the shell command
    This is my code

    dim retval
    retval = Shell("d:\batch _files\task_man agement\project \project.exe",1 )

    Thanks
  • Rick Rothstein

    #2
    Re: Problem with Shell Command in VB 5.0

    > I have this line in my code that spits out (run time error 53, file[color=blue]
    > not found).
    > Running this program (project.exe) works fine if I do it through the
    > command prompt or Run dialogue box on the Windows XP start menu, but
    > not when using the shell command
    > This is my code
    >
    > dim retval
    > retval = Shell("d:\batch _files\task_man agement\project \project.exe",1 )[/color]

    Does the project.exe program (seems strange that you have an EXE file in
    a directory whose name kind of indicates it contains only BAT files)
    itself attempt to open or run any files or programs? If so, perhaps it
    is using a relative path when attempting to do so. If that is the case,
    you should be able to use ChDrive and ChDir to set the working path to
    that which this (these) internally called file(s) require(s). You would
    execute these function calls prior to executing the Shell statement.

    Rick - MVP

    Comment

    Working...