"The system cannot find the file specified" when running ARL update

"The system cannot find the file specified" when running ARL update

Summary

This KB article addresses the error: "The system cannot find the file specified" which is recorded in the recognition.log when running the ARL update.

Symptoms

Your ARL update fails and you find the following error in the Recognition.log (usually found in C:\Windows\Temp):
 
 
Error running command: sqlcmd.exe -S SQL07SZD -d ManageSoft -b -i "C:\Users\svc-mgs\AppData\Local\Temp\Recognition\ARLCreateTables86.sql" -E
*******************************************************
ERROR
-------------------------------------------------------
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at ManageSoft.Recognition.Recognition.ExecuteSQLFile(LogWriter log, String filename)
at ManageSoft.Recognition.Program.ExecuteSQLFile(LogWriter log, Recognition arl, String sqlDir, String sqlFile)
at ManageSoft.Recognition.Program.Main(String[] args)
*******************************************************

 

Cause

This error means that either SQLCMD.exe file is missing or is not set in the PATH environment variable.
 

 

Resolution

Install Microsoft Command Line Utilities which includes the SQLCMD utility. 
Older versions of SQL Management Tools includes SQLCMD as part of the install however the newer 18.x versions of SQL Management Tools no longer includes the file making it necessary to install it separately using the Microsoft Command Line Utilities. If the older version of SQL Management Tools is installed and the PATH environment variable is not set automatically (due to User Account Control), the workaround section below contains a method to set the PATH if that is the case.

 

Workaround

If the path for SQLCMD.exe was not set in the PATH variable, use the method below:
 
  1. Install SQL Command Line Utilities (SQLcmd.exe + bcp.exe)
  2. Turn UAC off and then reboot
  3. Start cmd as Administrator
  4. Add the path of sqlcmd.exe using ?setx PATH <Actual Path to file> ?m?
  5. UAC can now be turned back on if required
 
The PATH should now be set and the ARL update should no longer produce the error covered by this article.

 

Additional Information

The <Actual Path to file> in the Workaround above depends on version, for example on 2008 it is: "C:\Program Files\Microsoft SQL Server\100\Tools\Binn" - the 100 is what shows it is 2008, so make sure that you use the correct folder for your version.

Was this article helpful? Yes No
No ratings
Comments

@sunshine ,

same issue occurred in our environment.

we followed the below steps.

  1. Install SQL Command Line Utilities (SQLcmd.exe + bcp.exe)
  2. Turn UAC off and then reboot
  3. Start cmd as Administrator
  4. Add the path of sqlcmd.exe using ?setx PATH <Actual Path to file> ?m?
  5. UAC can now be turned back on if required

now it's working fine.

Thanks,

sreerama yenuga

Version history
Revision #:
5 of 5
Last update:
‎Jun 25, 2020 12:26 AM
Updated by: