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
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:
-
Install SQL Command Line Utilities (SQLcmd.exe + bcp.exe)
-
Turn UAC off and then reboot
-
Start cmd as Administrator
-
Add the path of sqlcmd.exe using ?setx PATH <Actual Path to file> ?m?
-
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.
05-26-2023
To add to the information above. It is possible, if multiple versions of the SQL Management Tools exist on the machine, that the Path statement may need to be altered. To check this;
1. Right click the start button and click on System.
2. On the left, click on 'Advanced System Settings'.
3. In the pop-up, click on Environment Variables.
4. In the lower part of the window that pops up, within 'System Variables', click on Path and Edit.
5. We are looking for lines similar to 'C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\', and would want to ensure that the latest version is at the top of the list.