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

Passing Variable to Batch File to Process

$
0
0
I have a situation where a file is created during runtime of vb code. The file is stored in a folder. Later in the code the file is located in the folder and needs to be passed to a bat file for a procedure. For example, file (xfile) is created and stored at c:\myfile\xfile.txt. I need to process this file thru a batch file.
batchfile="c:\mybatch\batchfile.bat". Notice the file to processed and the batchfile are not in same directory. I have tried

Shell batchfile & xfile
this doesn't work, I get invalid procedure or call.
I have tried it by hard coding the batchfile into the code and still doesnt work.

Tied
Set cresult=Createobject ("WScript.Shell")
cresult.run batchfile & xfile

still can't get it to work.

Any advice to point me in new direction much appreciated.
Thanks

Viewing all articles
Browse latest Browse all 21254

Trending Articles



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