Forum Discussion

KenReilly's avatar
KenReilly
Occasional Visitor
4 years ago

(58, 2) WshShell.Exec: The system cannot find the file specified.

Hi there. This script has never failed to run before - although it is only run about once a year. The error is the subject above. 

Here is the offending VBS script:

 

 

function execQuery(sSQL, sFileName, sStatusText)
dim cmdline, oExec, iTime
dim bStillRunning
bStillRunning = false
cmdline = "osql -E -S" & sServer & " -d" & sDatabase & " -w1000 -Q " & chr(34) & sSQL & chr(34) & " -o" & chr(34) & sOutputLocation & "\" & sFileName & chr(34)
set oExec = WshShell.Exec(cmdline)
wscript.echo sStatusText & " [pid: " & oExec.ProcessId & "] "
Do While oExec.Status = 0
WScript.Sleep 100
iTime = iTime + 1
'if iTime > 100 then
'wscript.echo vbtab & "...continuing asynchronously with other scripts. "
'WScript.Echo vbtab & sFileName & " will be available when processid " & oExec.ProcessId & " terminates"
'WScript.Echo
'bStillRunning = true
'exit do
'end if
Loop

if bStillRunning = false then
WScript.Echo "........COMPLETED [" & sOutputLocation & "\" & sFileName &"]"
WScript.Echo
end if

end function

 

 

I am not a script writer or programmer ...please help! This vbs script is being called by a batch file. The bold above is line 58

 

Thank you

Ken

1 Reply

  • sonya_m's avatar
    sonya_m
    SmartBear Alumni (Retired)

    Hi KenReilly , could you help us understand, which SmartBear tool does this question relate to?

    Are you asking about TestComplete?