Solved sending parameters in batch through vbs script parameters

April 16, 2013 at 07:08:26
Specs: Windows 7
When running lookatbat.bat, I receive an error that means a file (file1WithSpaces.txt) has not be found.I have tried using the fix in this forum, but I receive the same error even with this code.

Here's a piece of lookatbat.bat, it makes a call to a vbs script using relative paths

cscript process.vbs /x:"Temp\file1WithSpaces.txt" /y:"Temp\file2WithSpaces.txt"

process.vbs make a call to a bat file (InprocessVbs.bat) which uses the first one parameter of process.vbs

process.vbs has many instructions, here's a useful part of process.vbs

dim param1: param1=Wscript.Arguments.Named("x")
dim param2: param2=Wscript.Arguments.Named("y")
msgbox param1 "InprocessVbs.bat """ & param1 & """ ""file.txt"""

msgbox param1 popups Temp\file1WithSpaces.txt but I think param1 does not retrieve properly into InprocessVbs.bat

Thanks for your help!

See More: sending parameters in batch through vbs script parameters

Report •

April 16, 2013 at 16:03:01
✔ Best Answer
It's OK.
problem was in "InprocessVbs.bat" because I was using something like cscript essai.vbs %1>spec%1 instead of cscript essai.vbs %~f1>spec%~n1. This last one allows manage relative path (with "\").


Report •
Related Solutions

Ask Question