External command

An external command is an MS-DOS command that is not included in command.com. External commands are commonly external either because they require large requirements or are not commonly used commands. The illustration shows each of the external commands are separate files. However, the internal commands are all included in the command.com file.

external command, internal command

Listing of external commands

Below are examples of MS-DOS and Windows command line external commands currently listed on Computer Hope.

  • Append
  • Arp
  • Assign
  • At
  • Attrib
  • Backup
  • Bcdedit
  • Bootsect
  • Cacls
  • Chcp
  • Chkdsk
  • Chkntfs
  • Choice
  • Cipher
  • Clip
  • Comp
  • Compact
  • Convert
  • Debug
  • Defrag
  • Delpart
  • Deltree
  • Diskcomp
  • Diskcopy
  • Doskey
  • Dosshell
  • Driverquery
  • Dumpchk
  • Edit
  • Edlin
  • Expand
  • Extract
  • Fasthelp
  • Fc
  • Fciv
  • Fdisk
  • Find
  • Forfiles
  • Format
  • FTP
  • Gpupdate
  • Graftabl
  • Help
  • Hostname
  • ICacls
  • Ipconfig
  • Label
  • Loadfix
  • logoff
  • Mem
  • Mode
  • More
  • Move
  • Msav
  • Msbackup
  • Mscdex
  • Mscdexnt
  • Mwbackup
  • Msd
  • Msg
  • Nbtstat
  • Net
  • Netsh
  • Netstat
  • Nlsfunc
  • Nslookup
  • Pathping
  • Ping
  • Power
  • Print
  • Reg
  • Robocopy
  • Route
  • Runas
  • Sc
  • Scandisk
  • Scanreg
  • Schtasks
  • Setver
  • Sfc
  • Share
  • Shutdown
  • Smartdrv
  • Sort
  • Subst
  • Sys
  • Systeminfo
  • Taskkill
  • Tasklist
  • Telnet
  • Tracert
  • Tree
  • Tskill
  • Undelete
  • Unformat
  • Wmic
  • Xcopy

Where are the external command files stored?

Many of the external commands are located in the Windows\system32 or Winnt\system32 directories. If you need to locate the external file to delete it, rename it or replace it, you can also find the file through MS-DOS.

How do you run an external command?

As long as the file exists and you have the proper paths, an external command runs just like an internal command by typing the command name at the prompt. However, if the paths are not set properly or they are missing because the command line would not know where to look for the external command, you would get an error. Unless of course you were in the same directory as the command.

How to change the default file encoding in Sql Server Management Studio

Recently I was working on SQL code and data migration engagement for a major Financial institiuation. I was leading the team of SQL developers on this proposition. We have been provided thousands of SQL scripts and hundreds of Stored Procedures along with similar amount of user-defined SQL database functions to convert them in new supporting format. Developers were converting the SQL codes, saving it and committing these to the version-control system GIT.  During Database code analysis and review (which follows immediately after development) to reduce the number of “code smells” that creep into your database builds, the Governance team noticed something wrong with the file encoding.

So, What went wrong?

The file that is used to create a new query window has ANSI encoding but when they save the file it was in UTF-16. Unicode characters were broken 🙁

It didn’t took much time to figure out the issue and resolve, but I decided to write the article explaining steps to resolve.

The default encoding for SQL Server Management Studio sql files is UTF-16, more specifically, either Western European (Windows) - Codepage 1252 or Unicode - Codepage 1200. These encodings play havoc with a git diff as these encoding appear as binary files.

Advanced Save Options

The preferred encoding is Unicode (UTF-8 with signature) - Codepage 65001

How to solve the File encoding in SSMS?

We can change the default file encoding in order to be the one we want in the first place. What I have done was change from ANSI encoding to UTF-8.

  • From within SSMS, open the sql template file named SQLFile.sql, by default in one of these locations: –
    • %ProgramFiles%\Microsoft SQL Server\[Sql Version]\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql\
    • %ProgramFiles(x86)%\Microsoft SQL Server\[Sql Version]\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql\
    • %ProgramFiles%\Microsoft SQL Server\[Sql Version]\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql
    • %ProgramFiles(x86)%\Microsoft SQL Server\[Sql Version]\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql

My path to the file is C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql where the 140 stands for the SSMS v17 (in my case, right know I’m using the v17.5).

Save File with Encoding

  • Resave using correct encoding:
    • File => Save As
    • Click the arrow next to the Save button
    • Choose the relevant encoding: Unicode (UTF-8 with asignature) - Codepage 65001

Advanced Save Options

All new query windows will default to UTF-8 files

Logging WWWTF