New
#1
vbs how to execute a command with quoted parameters
Hi,
OS: Win7 64bits Family
Can't find the way to fix quoting issue.
Suppose in the command prompt this works:
"c:\what ever\my program.exe" "d:\some dir\my file.txt" cat 1-2 output "d\some dir\_out.txt"
How do I make this into some vbs scripting?
I tried this:
I get:Code:exePath= "c:\what ever\my program.exe" spath= "d:\some dir\" iFile = spath & "my file.txt" oFile= spath & "_out.txt" iNumber=2 cli = Chr(34) & exePath & Chr(34) & " " & Chr(34) & sFileSelected & Chr(34) & " cat 1-"& iNumber & " output " & Chr(34) & oFile & Chr(34) Dim objShell Set objShell = WScript.CreateObject( "WScript.Shell" ) Cmd=Chr(39) & cli & Chr(39) objShell.Run(Cmd) Set objShell = Nothing
error 80070002 “The system cannot find the file specified”
Thanks