Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

ShellExecute not working on some programs

$
0
0
Hello All
I have to support a legacy program written in vb6 that runs on a network. The network is not a server setup, just a group of workstations with different shared folders, the program is located on a central computer and runs from the different workstations that were set-up for it
The executables being launched are located in the same dir as the main program and were also created in vb6 and are all launched using the shell command.

The other day a change was made to one of the modules and now it will not launch. At first it was giving an "error 5 invalid procedure call or argument"
Went back and re-looked at the code and everything seemed ok, changed the main program to use ShellExecute instead of shell and the error went away but the module doesn't start.
If you start the module manually (click on the executable on the network) it runs fine. but not through the main program.

It runs fine if you launch it using the main program running on the machine it's located on.

Only fails when trying to run over the network and only on this one module.

Anyway, I checked the path for the shellexecute and where it was app.path & "\program.exe" it was coming out as \\networkcomputer\networkfolder\\program.exe so for whatever reason it added a trailing "\" to the app.path as if it was a root drive instead of a folder.
The other calls to different modules are exactly the same but return the correct path "\\networkcomputer\networkfolder\otherprogram.exe" and work fine
Re-wrote the code to check for "\" and now the path for the shellexecture looks correct, still doesn't launch

Everything runs fine on my development machine and even if I run it off of my laptop over a shared folder (like their system)

Re-installed (just re-copied the module back) the original - pre-change module and it doesn't work anymore. so now it's not looking like the program is wrong, just a coincidence?

I'm at a complete loss, I'm now guessing it's a network\user\folder\??? permissions problem or something along those lines that just happened to pop up
Why would the app.path for give a trailing "\" on a network folder, but only for one call and not another ?

Any insight would be greatly appreciated
Thank
W

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>