TheoDeed TheoDeed - 1 year ago 145
Bash Question

Shell function error "invalid procedure call or argument"

After editing the batch file I want to run it. When I run it from the desktop, it runs properly, but from my program, I get the error:

invalid procedure call or argument

The batch file is in use until the VB6 program ends.

dRetVal = Shell("C:\Users\Theo\Desktop\BatchName.bat", vbMinimizedNoFocus)

What is wrong with this line? Or do you have other suggestions?

Answer Source

Batch files are run by C:\Windows\System32\CMD.EXE. CMD requires switches /c to run and exit and /k to keep running after the batch finishes. See cmd /?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download