Anders Danielsson Command Line Utilities

Download: ADC.1.0.0.56.zip

1 March 2024, 225 KB.
Click on file name to download (or use Save Link As...).

Manual

ADC - Anders Danielsson Command Line Utilities v1.0.0.56 Copyright © 1988-2024 Scandinavian Digital Systems AB Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- ADC is a collection of command line utilities ("commands"). Some commands are for general use, and some are for very special usage. Some commands originated as far back as 1988, originally written in ASM, C or C++, now converted to C#. Some commands are new. ADC is written in C#, using .NET Framework. ADC requires Microsoft .NET Framework 2.0 or later to be installed, see "ADC.ReadMe.txt". Common to all commands are: Unicode is supported. Console input and output uses the current code page, and if for example "CHCP 65001" is used, ADC will display and redirect using UTF-8. Most commands support the prefix "\\?\" in pathnames. "\\?\" allows paths longer than 260 characters. ADC supports up to 32767 characters. Syntax: \\?\D:\Path \\?\UNC\Server\Share\Path "\\?\" can only be used with absolute paths, not relative paths. Parent directory ".." and current directory "." may not be used. Usually the ERRORLEVEL is set to 0 on success, and in case of command line errors and other generic errors, the ERRORLEVEL is set to 255. List of available commands: addlines Add lines in text (log) files. asmdata Preprocessor for data in assembly languages. between Check if current time is between two times of day. blacklist Add or update firewall blacklist rules. bom List files using Byte Order Mark (BOM). bytepatch Search, replace and patch bytes in files. chartab Display tables of code page characters. cmake Execute commands from source code comments. cmdqueue Command queue processor. cmdverify CMD script/batch verify environment and paths. compare Compare two binary files. compdir Compare two directories (drives). cond Conditional list/del/copy of files that exists or not in dir. copydir Copy from a directory to another directory. crc Calculate Cyclic Redundancy Checksum (CRC). culture Display culture information. datetime Display the current date and time. daynumber Convert dates and daynumbers. delall Delete files and/or directories on search masks. delexcess Delete excess files and/or directories. delsame Delete equal files by comparing byte by byte. dosftime Search and fix files with non-DOS/FAT file times. dr List files and directories, similar to "dir". errexist Set ERRORLEVEL if file exists. fileinfo Display information about one file. fileopen Test if a file can be opened. files Create or update list of files in text files (Files.txt). filetest Write/read random files and measure write/read times. filter Filter text files. firmflash Update firmwares in devices. frm Pack firmware files to FRM files. ftpsend Send local files to a FTP server. get Set ERRORLEVEL on key pressed. hex Intel HEX file converter. hexview Displays Intel HEX files in human readable form. hmake Generates C/C++ header files. http Makes an HTTP request to an URL with optional body. imgconv Convert an image file to another format. info Display information about the system. log Write to log and maintain log files. makelist Generates list of files for NMAKE. mirror Copy non-equal (changed or new) files. msgbeep Display message with beep until key pressed. newest Display/Copy the newest of two files. numberlist Generate list of numbers. ping Standard Ping (ICMP Echo Request). poi Make Point Of Interest (POI) files and convert different formats. pwdgen Generates passwords. qsort Quick sort text files. rencase Rename files to upper or lower case. search Search text files. sendmail Send e-mail. sleep Sleep (wait) a time or until key pressed or a file not exists. sound Play sound from WAV file or a Windows system sound. stopwatch Measure the time between start and stop. tcpping Ping using TCP. terminal Serial communication terminal using COM-ports or TCP/IP. test Test ERRORLEVEL and/or if ADC is available for script/batch. textmake Make text files from binary files, images or text lines. textproc Process text files with conditions and variables. touch Set date and time of files. trim Trims text files. txtcode Decodes and encodes text files. udpping Ping using UDP. validarg Validates command line arguments. waitfile Waits until a file exists. Use "adc {command}" for help about a command. Use "adc /h" for help on all commands. Use "adc /m" to create the file "ADC.Manual.txt" (the manual for ADC) in UTF-8 format, with the same content as "adc /h" displays. Latest version of ADC may be downloaded at: http://www.digsys.se/ ------------------------------------------------------------------------------- adc addlines {dst} {src} ... [/l{num}] [/t] [/d{chr}] [/i{code}] [/o{code}] [/n] [/u] dst Destination output text file. src Source input text file. ... Many {src} files may be used. num Maximum number of lines to write to {dst}. Default and maximum is 1048576 lines. /t Trim lines, leading and trailing whitespaces are removed. This is done before any /d option is checked. /d Delete all lines starting with the character {chr}. Use a character or a Unicode number, e.g. /d# or /d35. Many /d{chr} may be used. If /d is used without {chr} then delete all empty lines. /i Default input character encoding to use when there is no existing BOM in a {src}. Default is the current system Windows ANSI code page. /o Output character encoding of {dst}. Default is the current system Windows ANSI code page. /n Do not add a Byte Order Mark (BOM) to {dst}. /u Write Unix newlines instead of Windows newlines to {dst}. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). "adc addlines" will first read all {src} in order, until up to {num} lines have been read. It will then write the {num} newest lines to {dst}. It accepts Windows, Unix, Mac Classic or inconsistent newlines characters. The line order is such that first {src} is newest, and the last line in a {src} is newest, i.e. as plain log files. Example: adc addlines fw.log pfirewall.log pfirewall.log.old /l30000 /t /d# /d /oUTF8 ------------------------------------------------------------------------------- adc asmdata {asm} {mark} {base} {dst} {src} ... asm Assembler syntax to use. See below. mark String to identify "adc asmdata" lines in the source files. This string must start with the comment character of the assembler, usually ";". The {mark} should be unique for this {dst}. base Name to be used as base of labels in the destination file. The {base} should be unique for this {dst}. dst Destination (target) output file. This file should only be changed by "adc asmdata". It should have a unique {mark} and {base}. src Source input file(s). Wildcards are valid. Hidden and/or system files are ignored. ... Many source files separated with spaces may be used. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc asmdata" is a preprocessor for data in assembly languages. If the source files uses Unicode BOM, the destination file will use the same encoding. Without BOM, the current system Windows ANSI code page will be used on all files. Any BOM mismatches will give an error. The destination output file will only be written to (and get its date and time updated) if there are any changes in the file. {asm} is one of: MPASM Microchip MPASM and MPASMWIN for PIC MCU Source file with "adc asmdata" lines at column 0: {mark} [{name}] [{type} {data}] mark The marker as defined on the command line. The marker starts with the comment character, so the entire line will be like a comment for the assembler. name Name used to make labels of the data. The labels "{name}_ADDR" and "{name}_SIZE" will be created, that may be referenced and used by the ASM code. Use no {name} to continue with more lines with data for the last {name}. type Data storage type, one of: DB, DW, DD, or DQ. {type} and {data} are optional, to create a {name} with data on the following lines. data Data for the type. May be multiple data separated by commas. C/C++ style integers and strings are handled by "adc asmdata", other expressions by the assembler. Strings are surrounded by " or ', and may have C/C++ escape sequences. Strings are always encoded to bytes using the current system Windows ANSI code page. Source file with "adc asmdata" lines not at column 0: [{label}] {name} {mark} {type} {data} label Optional assembly language label not used by "adc asmdata". name Name used to make a macro that calls a user defined macro named "{base}_MACRO" with address and size as arguments. This macro will be executed by the assembler on this line. {name} must be used. mark The marker as defined on the command line. The marker starts with the comment character, so the rest of the line will be a comment for the assembler. type Data storage type, see above. {type} and {data} must be used. data Data for the type, see above. Example of command line: adc asmdata MPASM ";@ASMDATA" OUTPUT txtstr.inc *.asm Example in assembly language source code: INCLUDE "txtstr.inc" ;@ASMDATA Hello DB "Hello World\r\n" MacroPrint Hello_ADDR,Hello_SIZE DebugOutput ;@ASMDATA DB "Debug this\r\n" Result in the file "txtstr.inc" (only vital parts shown): OUTPUT_START EQU $ IF OUTPUT_DATA DB H'48',H'65',H'6C',H'6C',H'6F',H'20',H'57',H'6F' ;0x0000 Hello Wo DB H'72',H'6C',H'64',H'0D',H'0A',H'44',H'65',H'62' ;0x0008 rld\r\nDeb DB H'75',H'67',H'20',H'74',H'68',H'69',H'73',H'0D' ;0x0010 ug this\r DB H'0A' ;0x0018 \n ENDIF ;OUTPUT_DATA OUTPUT_END EQU $ OUTPUT_SIZE EQU $-OUTPUT_START Hello_ADDR EQU OUTPUT_START+H'0000' Hello_SIZE EQU H'000D' DebugOutput MACRO OUTPUT_MACRO OUTPUT_START+H'000D',H'000C' ENDM ------------------------------------------------------------------------------- adc between {time0} [...] [/z{zone}] [/w{level}] time0 Time 0 in the format HH:mm:ss. ... Time 1, 2, ..., n. /z Use the time zone specified as hours from UTC, default is the local time of the system. /w When returning with ERRORLEVEL = {level}, wait (sleep) until until time >= Time {level}. Limited to 1 hour waiting time. Sets ERRORLEVEL to: 0 Current time < Time 0 1 Current time < Time 1 2 Current time < Time 2 n Current time < Time n n+1 Current time >= Time n 255 Generic error. Example of usage in a script/batch: adc between 04:00:00 07:00:00 08:00:00 /w2 if %errorlevel%==0 goto event00to04 if %errorlevel%==1 goto event04to07 if %errorlevel%==2 goto event07to08at08 if %errorlevel%==3 goto event08to24 goto error_adc ------------------------------------------------------------------------------- adc blacklist {name} [/b{black}] [/w{white}] [/1] [/k] [/t{text}] [/l{log}] [/o{code}] [/z{zone}] [/r{form}] [/a] [/d] name Base name of firewall rules, Full names will be "{name}NNN", where NNN is a three-digit number. Only ASCII labels allowed. black Text file with IP addresses to block. Multiple /b{black} can be used, put the largest file first. white Text file with exception IP addresses to never block. Multiple /w{white} can be used, put the largest file first. /k Kill (delete) all "{name}NNN" firewall rules. /t Leading text of console and log file outputs, default is /t" ". Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. /l Write log to file {log}, default is to output to the screen only. /o Output character encoding of the log file. Default is the current code page (CHCP). /z Use the time zone specified as hours from UTC, default is the local time of the system. /r C# date and time format to use on console and log file outputs, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc blacklist" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" Default is M0. /a Append to the log file, keeping any existing BOM and encoding. Default is to overwrite if file exist, ignoring any existing BOM. /d {log} is a directory with log files for each day, created by "adc log" or "adc blacklist". The log files are named "YYYYMMDD.log". When /d is used, then usually /a is used. If both /d and /a are used, then the log file is opened and closed for each line written, to be shared by other processes. Useful #HHHH escape sequences in {text}: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is the current code page (CHCP). Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc blacklist" will add or update firewall blacklist rules, using "Windows Firewall with Advanced Security" in Windows Vista and Server 2008 and newer. The input text files with IP addresses are read one line at a time, accepting Windows, Unix, Mac Classic or inconsistent newlines characters. Only lines starting with a valid single IP address are used, comments may be on the same line, using any white space character after the IP address. Both IPv4 and IPv6 are supported, but IP addresses are compared as strings. "adc blacklist" must be executed with administrator privileges. Maximum 999*1000=999000 IP addresses may be blocked. Examples: adc http GET https://lists.blocklist.de/lists/all.txt /rBlacklist.txt adc blacklist Blacklist /bBlacklist.txt /wWhitelist.txt adc blacklist Blacklist /k ------------------------------------------------------------------------------- adc bom {path} ... [/i{code}|/n{code}] [/s] path Pathname to a directory or a file, wildcards are valid. Hidden and/or system files are ignored. ... Many pathnames separated with spaces is allowed. /i Displays only files with a certain BOM (character encoding), default is to display all files with BOM information. /n Do not displays files with a certain BOM. /s Display found files in sub-directories also. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: None No Byte Order Mark (BOM). UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). "adc bom" does not do heuristic encoding detection, it only checks for any Byte Order Mark (BOM) in the beginning of the files. Note, if any option is used, but no pathname, then "*" is used. Default is to display all files with Byte Order Mark (BOM) information. Examples: adc bom /s adc bom *.txt /iUTF16LE adc bom /s /nUTF8 *.ashx *.aspx *.cs *.master *.config adc bom /s /nNone *.css *.js *.htm *.html robots.txt *.cmd *.bat ------------------------------------------------------------------------------- adc bytepatch {file} {oper} ... [/q] file File to read and write. oper Operation to perform. ... Many operations separated with spaces may be used. /q Quiet mode. Will not display patches. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Operation syntax: offset=search:replace@count search:replace@count offset=search:replace search:replace offset=replace offset= Start at offset in file, default is to search in the whole file. search: Byte sequence to search for, default is to patch without search. replace Byte sequence to write to the file at found positions. @count Exact number of found matches or 0 meaning any number of matches. Byte sequences are one or more byte values separated by commas. Examples of usage (with comments): adc bytepatch swedish.txt 197:143 196:142 214:153 229:134 228:132 246:148 /q Convert some swedish characters from code page 1252 (ANSI) to 437 (OEM). adc bytepatch bin.lib 0xC6,0x06,0x01,0x01,0xF7:0xC6,0x06,0x01,0x01,0xF3@1 Search a binary file for one match only and replace it. adc bytepatch prog.bin 0x3C3BB=0xF3 Write 0xF3 at position 0x3C3BB in the file "prog.bin". ------------------------------------------------------------------------------- adc chartab {cp} ... [/c] [/p] cp Code page number, 0 is the current code page (CHCP). ... Many code page numbers separated with spaces may be used. /c Sort and display a combined Unicode table of all code pages. /p Make a C# program conversion table. "adc chartab" displays tables of characters 0 - 255 in the wanted code pages. Examples: adc chartab 1252 adc chartab /c 1250 1252 1253 437 850 852 858 ------------------------------------------------------------------------------- adc cmake {src} {cmd} src Source file with $cmake markers. cmd Command with arguments to execute. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. If no BOM then the current system Windows ANSI code page is used. Example: adc cmake hello.cpp nmake /nologo NAME=hello Source file markers in MAK, ASM, C, C++ or C# comment lines at column 3: $cmake {command line arguments} The comment lines must start with "# ", "; " or " ". C++/C# comment lines using "//" cannot be used. For every $cmake found the command is executed. Example: /* $cmake TAR=DOS16 MOD=S $cmake TAR=DOS32 MOD=F */ Will execute two commands: nmake /nologo NAME=hello TAR=DOS16 MOD=S nmake /nologo NAME=hello TAR=DOS32 MOD=F See also "adc hmake" and "adc makelist". ------------------------------------------------------------------------------- adc cmdqueue {queue} [/z{zone}] [/t{min}] [/m] {log} [{max}] [/r{form}] [/d] queue Path to command queue file. /z Use the time zone specified as hours from UTC, default is the local time of the system. /t Maximum age of commands in minutes. Default is 1 year. Too old commands are ignored (removed). /m Execute multiple commands if available. log Path to log file or a directory with log files. max When used, then the log file will be shrunk if it is larger than {max} kilobytes. 20% of the first (oldest) lines will be removed. /r C# date and time format to use in the log file, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc cmdqueue" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" Default is M0. /d Path is a directory with log files for each day, created by "adc log" or "adc cmdqueue". The log files are named "YYYYMMDD.log". When /d is used, then usually {max} is not used. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. The command queue file must have the syntax: yyyy-MM-dd HH:mm:ss Command line with arguments yyyy-MM-dd HH:mm:ss.fff Command line with arguments Sets ERRORLEVEL to: 0 No command executed (command queue file is empty). 1 Command executed, may be more commands in queue (unless option /m). 255 Generic error. Example of usage: adc log cmdqueue.txt /t xcopy D:\Files D:\Backup\ /s adc cmdqueue cmdqueue.txt ------------------------------------------------------------------------------- adc cmdverify {level} [/e{env}] [/p{env}] [/o{env}] [/d{dir}] [/m{dir}] [/f{file}] [/v] level Level of validation of the Windows environment, see below. /e Verify that {env} in the environment is defined to anything. /p Verify that {env} in the environment is defined to a valid and existing directory (path). /o If {env} is defined then verify that it is a valid and existing directory (path). /d Verify that {dir} is a valid and existing directory (path). /m Verify and make directory {dir} if it does not exist. /f Verify that {file} is a valid and existing file (path). /v Verbose output, will display all verifications and actions. {level} is one of: 0 Do not verify standard Windows environment 1 Verify the environment variables, using the option: ALLUSERSPROFILE /p APPDATA /o ProgramFiles /o ProgramFiles(x86) /o ProgramW6432 /p TEMP /p TMP /p USERPROFILE /p windir /p 2 As 1, plus the variables for Windows Vista or newer: ProgramData /p PUBLIC /p All environment variables must exist and their values must be valid and existing directories (paths), except for "APPDATA", "ProgramFiles(x86)" and "ProgramW6432" that is optional, but if they exists, they must be valid and existing directories. A valid directory must not have the prefix "\\?\", must not end with "\", must have at least one name, must not contain the names "." and/or ".." and must be rooted (start with "\" or "X:\"). "adc cmdverify" sets ERRORLEVEL to 143 on success and if everything is OK. Typical usage in a CMD script/batch to verify that ADC is installed and available, and that the script is working in a minimum valid Windows environment (line breaks inserted for readability): @echo off setlocal enableextensions if not cmdextversion 2 (echo CMD extensions 2 not available!&exit /b 255) adc cmdverify 1 if not %errorlevel%==143 (echo ADC.EXE is not available or invalid environment!&exit /b 255) ... Another example in a CMD script/batch (line breaks inserted for readability): adc cmdverify 1 /eAPPDATA /eID /d"D:\USR\%ID%" /m"%APPDATA%\ADC" /v if not %errorlevel%==143 (echo ADC.EXE is not available or invalid environment!&exit /b 255) ------------------------------------------------------------------------------- adc compare {file1} {file2} [/b{begin}] [/e{end}] [/q] file1 Binary file 1. file2 Binary file 2. /b Beginning address/position (inclusive), default 0. /e Ending address/position (inclusive), default the largest file. /q Quiet mode. Will not display mismatching bytes. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Compare two binary files within given range. Sets ERRORLEVEL 1 if not equal. Example of usage: adc compare new.bin old.bin /q ------------------------------------------------------------------------------- adc compdir {dir1} {dir2} {except} ... [/n] [/s] [/rf|/ru|/rn] [/a] [/c] [/f{mask}] dir1 Directory 1. dir2 Directory 2. except Optional pathname string exception. If any exception string is found in a part of a pathname, including {dir1} or {dir2}, the file/directory is not compared. End with \ to match a directory. ... Many exceptions may be given. /n Compare not hidden and not system files/directories only. /s Compare file sizes. Include step #2 below. /rf Compare file times using 2 seconds resolution in local time. For FAT16, FAT32, exFAT, ISO 9660 (CDFS), UDF and others. File times are considered equal if the file time difference is less than or equal to 2 seconds ± 1 hour daylight saving. Include step #3 below. /ru Compare file times using 1 second file time resolution in UTC (GMT). For Unix file systems and others, e.g. Network Attached Storage (NAS). File times are considered equal if the file time difference is less than 1 second. Include step #3 below. /rn Compare file times using high precision 100 ns NTFS resolution in UTC (GMT). For NTFS partitions in Windows systems. Include step #3 below. /a Compare file attributes. Include step #4 below. /c Read and compare files byte by byte. Include step #2 and #5 below. /f Only compare files matching {mask}, with/without wildcards. No sub- directories are processed. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc compdir" reports all files in {dir1} that are not equal to files in {dir2}. Compare steps (levels): #1 Check if file exist #2 Check if same file size (only when option /s or /c) #3 Check if same file date/time (only when option /rf or /ru or /rn) #4 Compare file attributes (only when option /a) #5 Read and compare files byte by byte (only when option /c) #6 Extra files/directories in {dir2} Sets ERRORLEVEL bit 1<<(Level-1) on mismatch. Example of usage in a script/batch: @echo off echo Compare D:\Data with E:\Backup\Data adc compdir \\?\D:\Data \\?\E:\Backup\Data /c /rn /a ------------------------------------------------------------------------------- adc cond list {path} {cmd} {dir} [{type}] [/s] [/d|/b] [/t{text}] [/rf|/ru|/rn] [/ne] path File/Directory path, with/without wildcards. cmd One of the commands: ifexist ifnotexist ifequal ifnotequal dir Existing directory (no wildcards). type Optional file type (including dot) to replace the file type of each found entry of {path} before it is used with {dir}. /s Process found files in sub-directories also. /d The path must be a directory. Default is that the path must be a file. /b The path may both be a file or a directory. /t Text format for each found entry of {path}. Default: /t"$p$!" /rf Use 2 seconds file time resolution in local time. For FAT16, FAT32, exFAT, ISO 9660 (CDFS), UDF and others. File times are considered equal if the file time difference is less than or equal to 2 seconds ± 1 hour daylight saving. This is the default. /ru Use 1 second file time resolution in UTC (GMT). For Unix file systems and others, e.g. Network Attached Storage (NAS). File times are considered equal if the file time difference is less than 1 second. /rn High precision 100 ns NTFS file time resolution in UTC (GMT). For NTFS partitions in Windows systems. /ne Files not existing in {dir} are ignored for 'ifequal' and 'ifnotequal'. Default is that non-existing files are considered non-equal. Special $ character sequences in {text}: $p Pathname $q Pathname within " and " $f Filename with extension, without path $n Filename without path and extension $s Size of file in bytes, or the text "DIR", right-aligned by 12 characters $k Size of file in KB (1024 bytes) $m Size of file in MB (1024 KB) $g Size of file in GB (1024 MB) $t Size of file in TB (1024 GB) $a Attributes of file $d Date and time of file $! Newline $$ Dollar sign $ Useful #HHHH escape sequences in {text}: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # If the condition is met at least once then ERRORLEVEL is set to 0 else ERRORLEVEL is set to 1. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Files are considered equal if the file sizes and times are equal. Security attributes (ACL) and alternate data streams (ADS) are not copied. adc cond list {path} ifexist {dir} [/s] [/d|/b] List (display) files and/or directories in {path} that exist in {dir}. adc cond list {path} ifnotexist {dir} [/s] [/d|/b] List (display) files and/or directories in {path} that do not exist in {dir}. adc cond del {path} ifexist {dir} [/s] Delete files (not directories) in {path} that exist in {dir}. adc cond del {path} ifnotexist {dir} [/s] Delete files (not directories) in {path} that do not exist in {dir}. adc cond copy {path} ifexist {dir} [/s] Copy files (not directories) from {path} to {dir} that already exist in {dir}. adc cond copy {path} ifnotexist {dir} [/s] Copy files (not directories) from {path} to {dir} that do not exist in {dir}. adc cond list {path} ifequal {dir} [/s] [/d|/b] List (display) files and/or directories in {path} that are equal in {dir}. adc cond list {path} ifnotequal {dir} [/s] [/d|/b] List (display) files and/or directories in {path} that are not equal in {dir}. adc cond del {path} ifequal {dir} [/s] Delete files (not directories) in {path} that are equal in {dir}. adc cond del {path} ifnotequal {dir} [/s] Delete files (not directories) in {path} that are not equal in {dir}. adc cond copy {path} ifequal {dir} [/s] Copy files (not directories) from {path} to {dir} that are equal in {dir}. adc cond copy {path} ifnotequal {dir} [/s] Copy files (not directories) from {path} to {dir} that are not equal in {dir}. Example of usage in a batch/script: @echo off adc cond list SRC\*.CPP ifnotexist BIN .OBJ if %errorlevel%==1 echo All SRC\*.CPP has a BIN\*.OBJ ------------------------------------------------------------------------------- adc copydir {src} {dst} [{file} [...]] [/h] [/m{level}] [/q] [/v] [/sc] src Source directory (path). dst Destination (target) directory (path). file File or sub-directory (sub-path) to copy. Wildcards are valid. If {file} matches a directory, all its files and sub-directories are copied. Default is "*" if no {file} is used. ... Many {file} may be used. /h Copies hidden and system files also. Without option /h hidden and/or system files are ignored. /m After a successful file copy, the source file is deleted. Then processed sub-directories will also be deleted. This will be like a safe "move" of the files. {level} is the number of directory levels to skip before deleting (moving). The number {level} is optional, default is level 0 to move all found files. /q Quiet mode, will not display created directories or copied files. /v Verbose mode, will also display number of bytes and times. /sc Safe but slow synchronous file copy, use for e.g. bad networks. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc copydir" will copy files from a directory to another directory. Security attributes (ACL) and alternate data streams (ADS) are not copied. If option /v is used, and the console output is not redirected then the [ESC] key may be pressed to terminate the copy. See also "adc mirror". Example of usage in a script/batch (line breaks inserted for readability): @echo off setlocal enableextensions if not cmdextversion 2 (echo CMD extensions 2 not available!&exit /b 255) set NX0=%~nx0 adc cmdverify 1 /dS:\SYS /m"%APPDATA%\ADC" /f"S:\SYS\CMD\%NX0%" if not %errorlevel%==143 (echo ADC.EXE is not available or invalid environment!&exit /b 255) if "%~1"=="BatchCall" goto BatchCall adc copydir S:\SYS\ "%APPDATA%\ADC\" ADC.exe ADC.exe.config "CMD\%NX0%" if not %errorlevel%==0 exit /b 255 cd /D "%APPDATA%\ADC" "CMD\%NX0%" BatchCall exit /b 255 :BatchCall ... ------------------------------------------------------------------------------- adc crc {src} src Source input file. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Calculates Cyclic Redundancy Checksums (CRC) and other checksums of a file. Example of usage: adc filetest write test.bin 16M adc crc test.bin ------------------------------------------------------------------------------- adc culture {cult|-|.|*} [/n] [/a] [/v] cult Culture to display, e.g. "en-US". - Display the invariant culture. . Display the current user default culture. ! Display the installed user interface localized culture. * Display list of all available cultures. /n Display neutral cultures, default is specific cultures, when using *. /a Display abnormal cultures only, when using *. /v Display verbose output, when using *. "adc culture" displays information of cultures in the C# .NET Framework. Displayed strings, such as date and time formats, will use caret ^ escape sequences on special and white space charaters: ^t Tab ^s Soft Space (normal space) ^h Hard Space (non-break space) ^r Carriage Return (CR) ^n Line Feed (LF) ^^ Caret ^XXXX Unicode character with hexadecimal code XXXX ------------------------------------------------------------------------------- adc datetime {form} [/c{cult}] [/z{zone}] [/t{text} ...] form C# date and time format of output, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc datetime" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" /c Use the culture {cult} with the C# format, see "adc culture". If /c alone (no {cult}) then the current user default culture is used. Without option /c the invariant culture is used. /z Use the time zone specified as hours from UTC, default is the local time of the system. /t Any text that will be outputed after the date/time. /t must be the last argument, everything following /t will be used. Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Useful #HHHH escape sequences in {text} and {form}: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # "adc datetime" displays the current date and time. Examples: adc datetime F adc datetime g /cen-US adc datetime R /z0 adc datetime L0 /z-3.5 /t At GMT-03:30 Example of usage in a script/batch (line breaks inserted for readability): @echo off set UTC=ERROR for /F "usebackq tokens=* delims=" %%A in (`adc datetime C0 /z0`) do set UTC=%%A echo %UTC% ------------------------------------------------------------------------------- adc daynumber {type} [value] [/c{chr}] [/e{div}] type Type of input value: Local Current local date, no [value] is used UTC Current UTC date, no [value] is used Date Gregorian date in ISO 8601 format: ±YYYY-MM-DD Week Gregorian date in ISO 8601 format without 'W': ±YYYY-ww-D Day Gregorian date in ISO 8601 format: ±YYYY-DDD Julian Julian date in ISO 8601 format: ±YYYY-MM-DD XDN eXtended Day Number, positive integer, used internally JDN Julian Day Number, starts on Julian date 4713 BC Jan 1 RDN Rationalized Day Number, starts on 0001-01-01 WIN Day number of Windows NT file time, starts on 1601-01-01 MJD Modified Julian Day, starts on 1858-11-17 value Input value to convert, see above. /c Output one single line with {chr} as separator (delimiter). Use a character or a Unicode number. Default is /c32 (space). Outputs: ±YYYY MM DD ±YYYY ww D DDD RDN /e Set ERRORLEVEL to RDN % {div}, i.e. to the remainder of the division of RDN by {div}, RDN modulo {div}. 0 < {div} < 256. "adc daynumber" converts different date and day numbers. Examples: adc daynumber date 2011-11-07 adc daynumber rdn 734447 Example of usage in a script/batch (line breaks inserted for readability): @echo off for /F "usebackq tokens=1-8" %%A in (`adc daynumber local /c`) do (echo Date: %%A-%%B-%%C &echo Week: %%D-W%%E-%%F &echo Day: %%A-%%G &echo RDN: %%H) Another example: @echo off adc daynumber local /e7 if %errorlevel%==0 echo Monday if %errorlevel%==1 echo Tuesday if %errorlevel%==2 echo Wednesday if %errorlevel%==3 echo Thursday if %errorlevel%==4 echo Friday if %errorlevel%==5 echo Saturday if %errorlevel%==6 echo Sunday ------------------------------------------------------------------------------- adc delall {path} [/s] [/r] [/a] [/d{mask}] [/f{mask}] [/b{mask}] {except} ... [/x] path Base path (directory). /s Search in all subdirectories also. /r Register the delete of all files and directories on the next reboot. Only on Windows 2000 or later. Cannot be used on network shares. "\\?\" support only on Windows XP or later. /a Attempt ordinary delete, then execute again using /r. mask File/Directory mask, with/without wildcards. /d Search and delete only directories (not files) matching mask. /f Search and delete only files (not directories) matching mask. /b Search and delete both files and directories matching mask. Many /d, /f and /b options may be used. except Optional pathname string exception. If any exception string is found in a part of a pathname, including {path}, the file or directory is not deleted. End with \ to only match a directory. If {except} starts with "*" then "*" is replaced by {path}. ... Many exceptions may be given. /x Execute delete. Without option /x, the files and directories are only displayed and not deleted. Only when /x is used will they be deleted. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Example commands: Description and comments: adc delall C:\ /s /fproj.err Display all proj.err found on entire C: adc delall D:\ /s /btmp.* /b*.tmp Display all temporary files and dirs on D: adc delall C:\Doc /f"kill me.*" /x Delete all "kill me" files in C:\Doc adc delall C:\ /r /dTMP /x Delete the C:\TMP dir on the next reboot ------------------------------------------------------------------------------- adc delexcess {path} {count} [/n] [/d] [/z] [/r] [/x] path Pathname to a directory or a file, wildcards are valid. count If {count} > 0 then number of found files/directories to keep. If {count} <= 0 then delete all files older than -{count} days and ignore options /n. /n Use sorted (ordinal Unicode) file names instead of file dates/times. /d The path must be a directory. Default is that the path must be a file. /z Zero size files (no /d) or empty directories (when /d) are not counted and always deleted. /r Register the delete of files and directories on the next reboot. Only on Windows 2000 or later. Cannot be used on network shares. "\\?\" support only on Windows XP or later. /x Execute delete. Without option /x, the files and directories are only displayed and not deleted. Only when /x is used will they be deleted. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc delexcess" will keep the newest {count} number of files (or directories), and delete all excess old files. Or if {count} < 0 then "adc delexcess" will keep all files up to -{count} days old. Examples: adc delexcess C:\BackupFiles\Day.*.zip 30 /z /x adc delexcess C:\BackupFolders\* 10 /n /d /x adc delexcess OnlyToday*.log 0 /x adc delexcess Previous7Days*.log -7 /x ------------------------------------------------------------------------------- adc delsame {master} [{slave}] [/x] master Path (directory) of master (original) files. slave Optional path (directory) of slave files to delete. Default is to use the same path as {master}, keeping first found files in ordinal Unicode sort order. /x Execute delete. Without option /x, the files are only displayed and not deleted. Only when /x is used will they be deleted. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc delsame" will for each file in {master} compare byte by byte all files in {slave}, and delete all equal files in {slave}. All file names, flags, dates and times are ignored. Hidden and/or system files are not included (processed) in both {master} and {slave}. All not hidden and not system sub-directories are included (processed). If any same file is found (and deleted when /x) then ERRORLEVEL is set to 1 else ERRORLEVEL is set to 0. Examples: adc delsame D:\Photos adc delsame D:\PhotoStorage D:\NewPhotos /x ------------------------------------------------------------------------------- adc dosftime {path} ... [/s] [/a] [/x] path Pathname to files, wildcards are valid. ... Many pathnames separated with spaces is allowed. /s Search in subdirectories also. /a Check and modify all time values: Create, Last-Access and Last-Write Without /a, only the Last-Write time is checked and modified. /x Execute date/time changes. Without option /x, the files are only displayed and not modified. Only when /x is used will they be modified. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Searches for files with non-DOS/FAT file date and times, and when /x is used, rounds the Last-Write and Create times to be an even number of whole seconds or nearest date for the Last-Access times. All dates are made within the limits January 1, 1980 to December 31, 2107. Examples: adc dosftime C:\Doc\*.txt /s /x ------------------------------------------------------------------------------- adc dr {path} ... [/t{text}] [/d] [/f] [/s] [/i] [/a{attr}] [/r{form}] [/c{cult}] [/z{zone}] [/w{dst}] [/o{code}] [/n] [/u] path Pathname to a directory or a file, wildcards are valid. ... Many pathnames separated with spaces is allowed. /t Text format for each found entry. /d Displays only directories (with no '\' after the directory names). /f Displays only files (not directories). /s Matching files in subdirectories are displayed. /i Displays file info, such as size, attributes, date, etc. This is almost the same as using /t"$p $s $a $d$!", but with $p left-aligned by 56 characters and with optional short file name at the end of the line. /a File/Directory attributes to match, see below. /r C# date and time format, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc dr" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" Default is H0. /c Use the culture {cult} with the C# format, see "adc culture". If /c alone (no {cult}) then the current user default culture is used. Without option /c the invariant culture is used. /z Use the time zone specified as hours from UTC, default is the local time of the system. /w Optional destination output text file. If no {dst} is used, or if {dst} is "CON", the output goes to the console and the options /o, /n and /u are ignored. /o Output character encoding of {dst}. Default is the current system Windows ANSI code page. /n Do not add a Byte Order Mark (BOM) to {dst}. /u Write Unix newlines instead of Windows newlines to {dst}. Special $ character sequences in {text}: $p Pathname $q Pathname within " and " $f Filename with extension, without path $n Filename without path and extension $s Size of file in bytes, or the text "DIR", right-aligned by 12 characters $k Size of file in KB (1024 bytes) $m Size of file in MB (1024 KB) $g Size of file in GB (1024 MB) $t Size of file in TB (1024 GB) $a Attributes of file $d Date and time of file $! Newline $$ Dollar sign $ Useful #HHHH escape sequences in {text} and {form}: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # {attr} is one or more letters of: Attribute: On: Off: Archive A N Read Only R W Hidden H V System S O Compress C U Encrypt E D Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Note, if any option is used, but no pathname, then "*" is used. Default is to display all files and directories without info. Examples: adc dr /i /z0 c:\sys\* adc dr *.txt /f /t"call procfile $q$!">temp.cmd adc dr \\?\C:\VeryLongPathExistsHere\* /s /aHS adc dr EXP\*.png /t"$d $n$!" /rL0 /wListPng.txt /oUTF8 ------------------------------------------------------------------------------- adc errexist {path} [/z] [/d|/b] [/t{time}] [{except} ...] path Pathname to a directory or a file, wildcards are valid. If any file exists then ERRORLEVEL is set to 1 else ERRORLEVEL is set to 0. /z Zero size files are treated as non existing. /d The path must be a directory. Default is that the path must be a file. /b The path may both be a file or a directory. time Time in the format HH:mm:ss. Files older than {time} are treated as non existing (ignored). except Optional name string exception. If a found file name is equal to the exception string, the file is ignored as if it does not exist. ... Many exceptions may be used. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Example of usage in a batch/script: adc errexist TMP\MyProj.ERR /z if errorlevel 1 goto error Another example in a batch/script: adc errexist D:\Process\* /t48:00:00 SETUP.TMP if %errorlevel%==1 goto process ------------------------------------------------------------------------------- adc fileinfo {path} [{count}] [/c{chr}] [/z{zone}] path Pathname to file, wildcards are valid. count Optional file found count to use. Default is 1. Files are sorted by ordinal Unicode. If {count} > 0 then select file number {count} from start. If {count} < 0 then select file number {count} from end. /c Output one single line with {chr} as separator (delimiter). Use a character or a Unicode number. Default is /c124, the | character. See script/batch examples below. /z Use the time zone specified as hours from UTC, default is the local time of the system. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Sets ERRORLEVEL to 0 if the file is found, sets ERRORLEVEL to 1 if not. Examples of usage in script/batch files (line breaks inserted for readability): @echo off for /F "usebackq tokens=1-17 delims=|" %%A in (`adc fileinfo C:\Path\Files*.txt /c`) do (echo Path: "%%~A%%~B%%~C" &echo Dir: %%A &echo Name: %%B &echo Extension: %%C &echo Size: %%D bytes &echo Size: %%E KB &echo Size: %%F MB &echo Size: %%G GB &echo Size: %%H TB &echo Size: %%I %%J &echo Year: %%K &echo Month: %%L &echo Day: %%M &echo Hour: %%N &echo Minutes: %%O &echo Seconds: %%P &echo Fractions: %%Q) @echo off set F=ERROR for /F "usebackq tokens=1-3 delims=|" %%A in (`adc fileinfo C:\Logs\Day-*.log -2 /c`) do set F=%%~A%%~B%%~C echo Yesterday log file: "%F%" @echo off set S=ERROR for /F "usebackq tokens=9-10 delims=|" %%A in (`adc fileinfo Backup.rar /c`) do set S=%%A %%B echo Backup size %S% ------------------------------------------------------------------------------- adc fileopen {path} [/w] [/q] [{sec}] [{loop}] [/u] path Pathname to files to open, wildcards are valid. /w Open files using write access, default is read access. /q Quiet mode. Will not display files and error messages. sec Seconds to keep each file opened, default is 0 seconds. loop Loop count to repeat the whole process. /u Enable user [ESC] key, terminates with ERRORLEVEL 2 if user press the [ESC] key. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Test if the files can be opened. Sets ERRORLEVEL 0 on success of all files. Sets ERRORLEVEL to 1 on first error. Example: adc fileopen D:\Proc\Running.log ------------------------------------------------------------------------------- adc files {dir} [{lst}] dir Pathname to a directory with files and directories to list. lst Filename of a text file in {dir} to read and write, default is to use "Files.txt". Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Creates or updates a list of files in a text file (Files.txt). Names of files and/or directories must be in the begining on each line in the text file. Spaces in names are converted to '_'. Hidden and/or system files are ignored. Example: adc files D:\DVD\Drivers Drivers.txt ------------------------------------------------------------------------------- adc filetest write|wr|w {file} {size} [{num}] adc filetest read|rd|r {file} [{size}] [{num}] [/c] file File to create or open with random data. size Whole (integer) number of bytes to write or read. May end with suffix: B K M G T P E Max size is 1 EB (1024 PB). For 'read' the default is the file's size. num Number of files to create or open, each file name will get a number suffix. E.g. if "MyFile.Bin" is used with {num} set to 10, then "MyFile01.Bin" to "MyFile10.Bin" will be created or opened. /c Compare and verify the read data. Do not use /c for performance tests. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Example of usage: adc filetest write D:\Pattern.Bin 256M adc filetest read D:\Pattern.Bin 256M /c adc filetest wr D:\Performance.Bin 16G 2 adc filetest rd D:\Performance.Bin 16G 1 ------------------------------------------------------------------------------- adc filter {src} {dst} {srch} {rplc} ... [/a] [/l] [/c{cult}] [/r] [/i{code}] [/o{code}] [/n] [/u] src Source input text file. dst Destination output text file. if {dst} is "CON", the output goes to the console and the options /o, /n and /u are ignored. srch Text to search, use " if spaces or other special characters such as ^ or |. Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. rplc Text to replace with, use " if spaces or other special characters. All found {srch} sequences will be replaced by {rplc}. Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. ... Many {srch} {rplc} pairs may be used. /a Write all lines to {dst}. Default is to only write lines with at least one match (found search and replace). /l Case insensitive search, ignoring upper/lower letters. /c Use the culture {cult} for upper/lower letters, see "adc culture". If /c alone (no {cult}) then the current user default culture is used. Without option /c the invariant culture is used. /r Use C# regular expression, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ regular-expression-language-quick-reference Escape sequences #HHHH are processed before the C# regular expression. /i Default input character encoding to use when there is no existing BOM in {src}. Default is the current system Windows ANSI code page. /o Forced output character encoding of {dst}. Default is the use the same encoding as {src} (or option /i). /n Do not add a Byte Order Mark (BOM) to {dst}. /u Write Unix newlines instead of Windows newlines to {dst}. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). "adc filter" does not do heuristic encoding detection, it only checks for any Byte Order Mark (BOM) in the beginning of the source file. The search and replace is done within single lines, accepting Windows, Unix, Mac Classic or inconsistent newlines characters. The Unicode characters #000A and #000D will never be found if used in the search string. Useful escape sequences: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # Example of usage in a script/batch (line breaks inserted for readability): set F=ERROR for /F "usebackq tokens=1-3 delims=|" %%A in (`adc fileinfo C:\Logs\SMTP-Activity-*.log -2 /c`) do set F=%%~A%%~B%%~C adc filter "%F%" C:\TMP\BadIp.txt /oUTF8 /r "^.+\t.+\t.+\t(.+)\t.+\t.+\t535 Invalid Username or Password\t.+\t.+\t(.+)\t" "$1 $2" adc qsort C:\TMP\BadIp.txt /q ------------------------------------------------------------------------------- adc firmflash serial {port} [/net] adc firmflash socket {host},{port},{ssl},{srv},{rev},{pfx},{pwd} [/c] Common arguments and options: {file} [/b] [/f] [/i] port Serial port name (port), e.g. COM1, without any ':'. Use * to get a list of all registred serial ports from "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM", all other arguments and options are ignored. /net Use .NET Framework for serial communication. host Host name or IP address, e.g. 192.168.1.10. port TCP port number to use, default is 23 (Telnet). ssl SSL/TLS protocol, one of: NOSSL No SSL/TLS protocol is used (default). NETSSL .NET Framework default SSL/TLS protocol. SSL2 SSL 2.0 protocol. SSL3 SSL 3.0 protocol. TLS10 TLS 1.0 protocol. TLS11 TLS 1.1 protocol, only .NET Framework 4.5 or later. TLS12 TLS 1.2 protocol, only .NET Framework 4.5 or later. srv Server name of {host} in certificates. Default {host}. rev Check certificate revocation list (R), or not (N). Default N. pfx Path and name of a PFX file. Default no personal ceritificates. pwd Password of the PFX file. Default no password. /c Enable Telnet "Interpret As Command" (IAC), including RFC-2217 Telnet Com Port Control Option. file Intel-HEX file with firmware. /b Batch-run one single device, without any pause prompts or user inputs. /f Force flash even if product mismatch. The device is not checked to match the Intel-HEX file. /i Flash product ID also. May reset serial numbers and other factory settings, depending on the type of product. "adc firmflash" updates the firmware in the flash memory of various embedded systems using the "PIC Bootware Serial Protocol". Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Example of usage: adc firmflash serial COM3 RemoteMeter.hex ------------------------------------------------------------------------------- adc frm {cmd} ... cmd Command, one of C, V, E, or O. See below. ... Options for the command. "adc frm" is a firmware packer, intended for low level embedded systems and similar, with low capacity to manage files. It packs multiple files together into one FRM file, to be transported/distributed to devices/clients. adc frm C {frm,cid,pid,rel} {file,mthd,fid} ... frm FRM file to create. cid Company identification (32-bit integer). pid Product identification (32-bit integer). rel Release number (32-bit integer). file File to put in FRM file (no wildcards). mthd Method of storage: 0 Compression No / Encryption No 1 Compression Yes / Encryption No 2 Compression No / Encryption Yes 3 Compression Yes / Encryption Yes fid File identification (32-bit integer). Must be unique within the FRM. ... Many "{file,mthd,fid}" may be used. Example: adc frm C ACME.FRM,13,147,4 PIC.02.BIN,3,2 CPU.BIN,3,1 adc frm V {frm} frm FRM file to view and test. Example: adc frm V ACME.FRM adc frm E {frm} [{path}] frm FRM file to extract the files from. path Destination path, default is the current directory. The files are named "{fid}.FIL", where {fid} is the eight digit hexadecimal number from "adc frm C" above. Example: adc frm V ACME.FRM D:\Files adc frm O {frm,0,pid,0} {file,mthd,fid} ... Same as 'C' but using an old and obsolete revision of the FRM file. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. ------------------------------------------------------------------------------- adc ftpsend {ftp} {src} {dst} [{except} ...] [/f{mask}] [/m] [/s{size}] [/y{time}] [/b{busy}] [/v] [/t{text}] [/l{log}] [/o{code}] [/z{zone}] [/r{form}] [/a] [/d] ftp Text file with FTP configurations, see below. src Local source path (directory) of files to send (copy). dst FTP server destination directory, relative to the root directory. Use "." if the destination directory is the same as the root directory. except Optional pathname string exception. If any exception string is found in a part of a local source pathname, the file or directory is not sent. End with \ to match a directory. ... Many exceptions may be used. /f Only send files matching {mask}, with/without wildcards. No sub- directories are processed. Multiple /f may be used. /m After a successful file copy, the file is deleted on the local source. Then processed sub-directories will also be deleted. This will be like a safe "move" of the files. /s File read buffer size in KB, 1 - 1024, default is 64 KB (65536 bytes). The TCP send buffer size is the same if option /y is used, or four times larger when /y is not used. A cache is used if {size} is 16 KB or less. /y Yield to other tasks for background FTP. {time} is optional yield time in milliseconds for each TCP send of {size} KB binary data or one ASCII line, default is 1 ms when /y is used without {time}. /b Start by sending the busy file {busy} to {dst}. When everything is done without any errors, the busy file at {dst} is removed. /v Verbose output, will display all FTP commands and responses. /t Leading text of console and log file outputs, default is /t" ". Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. /l Write log to file {log}, default is to output to the screen only. /o Output character encoding of the log file. Default is the current code page (CHCP). /z Use the time zone specified as hours from UTC, default is the local time of the system. /r C# date and time format to use on console and log file outputs, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc ftpsend" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" Default is M0. /a Append to the log file, keeping any existing BOM and encoding. Default is to overwrite if file exist, ignoring any existing BOM. /d {log} is a directory with log files for each day, created by "adc log" or "adc ftpsend". The log files are named "YYYYMMDD.log". When /d is used, then usually /a is used. If both /d and /a are used, then the log file is opened and closed for each line written, to be shared by other processes. Useful #HHHH escape sequences in {text}: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is the current code page (CHCP). Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc ftpsend" sends local files to a FTP server. Hidden and/or system files are not sent. All not hidden and not system sub-directories are processed, unless option /f is used. The {ftp} file contains at least four lines with: 1 Host name or IP address, with optional comma and port number (default 21). 2 Login username. 3 Login password. 4 Remote FTP root directory (combined with {dst}). 5 File extension that uses the ASCII mode transfer, e.g.: .pl . Many lines with file extensions may be used. If no BOM then the current system Windows ANSI code page is used. Examples of usage: adc ftpsend mysite.ftp D:\WEB\mysite\ httpdocs\ /bD:\WEB\App_Offline.htm adc ftpsend C:\Sys\SendBackup.ftp C:\Bck\ . /fBackup.zip /s8 /y /t"FTP " /lC:\Log /oUTF8 /z0 /a /d Example of "mysite.ftp": ftp.mysite.com mylogin mypassword \ .pl .cgi .t ------------------------------------------------------------------------------- adc get {chars} [/b{sec}] [/e{sec}] /t chars String of characters to accept as keyboard inputs. /b Seconds between beeps. /e Seconds until exit. /t Test and display a key input. On exit ERRORLEVEL is set to the position of the inputed character in the string of characters. The comparision is case insensitive. Escape sequences in the string of characters: \n Enter \r Enter \t Tab \v Ctrl-J or Ctrl-Enter \b Backspace \f Ctrl-L \a Ctrl-G \e Escape \\ Backslash \uhhhh Unicode character whose code is hexadecimal hhhh \xhh Extended key whose code is hexadecimal hh \o Refer to all other keys not specified in the character string Use \u0022 for the quotation mark ". Use \u002F for the forward slash / (if the first character). Use option /t to get the character or escape sequence to use. If option /e is used, ERRORLEVEL is set to 254 after {sec} seconds. In case of any errors, ERRORLEVEL is set to 255. Example of usage in a batch/script: @echo off echo Continue (Y/N)? adc get "YN" /b6 if %errorlevel%==1 goto yes if %errorlevel%==2 goto no goto error ------------------------------------------------------------------------------- adc hex {mem},... /s{src},{opt},... /d{dst},{opt},... mem Memory areas and options, see below. /s Source input file {src} with options {opt}. /d Destination output file {dst} with options {opt}. ... Many options may be used separated by commas. Many /s and /d may be used, to read multiple input files, and to write multiple output files. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc hex" is an Intel HEX file converter. It follows these steps: 1) Allocate memory areas and fill with byte values. 2) Read all input sources (HEX files and/or binary files). 3) Patch single byte values in the memory areas. 4) Adjust memory area sizes (limits). 5) Special memory area processing. 6) Calculate checksums. 7) Write all output destinations (HEX files and/or binary files). Options for "{mem},...", # is memory area number (1, 2, 3, etc): a#=A-B Address range of memory area # from A to B (inclusive). This must be specified for any used memory area #. No memory area may overlapp another. Addresses A and B may be within 0 and 0xFFFFFFFF, but the size B - A + 1 must be less than 0x80000000 (2 GB). f#={value} Byte value to fill memory with, default 0xFF when only "f#", or use "f#=RND" for random values. If no "f#" is used then the memory is filled with 0x00. The random values uses a fixed seed and restarts on each "a#", so the results are repeatable. p={a}:{v} Patch the byte at address {a} with the value {v} after reading all "/s{src},{opt},...". Many "p" may be used. The address {a} must be within any of the defined "a#=A-B" memory areas. d#={dynamic} Change memory area limits A and B dynamically. {dynamic} may be: DYNLOW Increase limit A DYNHIGH Decrease limit B DYNRANGE Increase/Decrease both limits A and B After all "/s{src},{opt},..." have been read and after all patches have been done, the limits A-B will be shrunk to fit the actual used memory area. All references to the shrunken parts done by options "c={c}/C:D-E", "o#=I-J" and "p=K" will be adjusted accordingly. Note, if a default value for C is used in an area with decreased limit B, the source input must include the checksum storage bytes. s#={special} Special memory areas processing. {special} may be one of: BOOTWARE PIC Bootware Serial Protocol Rev 01 BOOTWR08 PIC Bootware Serial Protocol Rev 08 PICWARE4 PIC Boot and Firmware Rev 4 When using these, all checksum calculations needed by the firmware are automatically done and normally no "c" parameters for this memory area are needed. See also other documentations. c={c}/C:D-E Calculate checksum of address range D to E (inclusive) and store it at address C. Many "c" may be used, the addresses C, D and E must be within any of the defined "a#=A-B" memory areas. "-E", "D-E" or "/C:D-E" may be omitted. C is by default the highest B minus the checksum storage size, D is by default the lowest A or the previous C plus the checksum storage size if many "c" are used, E is by default the address C-1. If the range D-E crosses many "a#=A-B" memory areas, then the calculation skips over any empty spaces between them. {c} is one of: SUM16LE, CRC16LE, FCS16LE, CRC32LE, SUM16BE, CRC16BE, FCS16BE, CRC32BE Where LE is Little Endian (Windows/Intel) and BE is Big Endian (Unix/Motorola). See also "adc crc". The calculations are done after reading all "/s{src},{opt},..." and after all patching. Options for "/s{src},{opt},...", # is memory area number (1, 2, 3, etc): t={type} Type of input file HEX or BIN. Default is HEX. i#=F-G Input address range from F to G (incl) to memory area #. "i#" must be specified to tell what memory area # to use, but "=F-G" may be omitted to use A-B from the memory options. If not "t=BIN" then multiple "i#" may be used, to read into different memory areas or different parts of the same memory area. If "t=BIN" then the binary file must have the size H + G - F + 1 or an error is reported, unless "u" is used. m=H Move (translate) from input file address/position H to F within the last defined range F-G. If no "m" is used then no move is done, that is for HEX files H = F and for BIN files H = 0. Parameter "m" must be specified immediately after "i#". u Unwanted and unused data outside all "i#=F-G" will be silently discarded without any error messages if "u" is used. Options for /d{dst},{opt},..., # is memory area number (1, 2, 3, etc): t={type} Type of output file HEX8, HEX16, HEX32 or BIN. Default is BIN. HEX8 Intel HEX with 16-bit addresses (max 64 KB) HEX16 Intel HEX with 20-bit addresses (max 1 MB) HEX32 Intel HEX with 32-bit addresses (max 4 GB) Usually is only "t=BIN" or "t=HEX32" used. HEX8 and HEX16 should only be used if absolutely necessary. r={value} Reduce HEX file output by removing lines with only bytes equal to {value}, default 0xFF when only "r". This is not possible when "t=BIN". f={value} Byte value to fill BIN file with, default 0xFF when only "f", or use "f=RND" for random values. If no "f" is used then the BIN file is filled with 0x00. The random values uses a fixed seed and restarts on each "o#", so the results are repeatable. This option is not used when not "t=BIN". o#=I-J Output memory area # range I-J to the output file. "o#" must be specified to tell what memory area # to use, but "=I-J" may be omitted, I-J is by default A-B. Multiple "o#" may be used, to write from different memory areas or different parts of the same memory area, even when "t=BIN". If for example, using "t=BIN" with only one "o#" then a binary file will be created with the size K + J - I + 1, where the first K bytes are jumped over and filled as defined by "f" above. Special option is "o#=PICWARE4", when automatic detection of firmware addresses I-J has been done by using memory option "s#=PICWARE4". p=K Output position (address, offset) in the output file for the last defined range I-J. If no "p" is used, then K is by default 0 or the next output position if many "o#" are used. Parameter "p" must be specified immediately after "o#". Example for C165 MCU, line breaks and comments inserted: a1=0x000000-0x0007FF, Interrupt vectors and code in RAM a2=0x200800-0x203FFF, Code in ROM, part I a3=0x208000-0x23FFFF, Code in ROM, part II f1,f2,f3, Fill with 0xFF c=CRC16LE CRC of all areas stored at 0x23FFFE /sC165.HEX, Input "C165.HEX" i1,i2,i3 Input to all memory areas /dC165.BIN, Output "C165.BIN" o1, Output memory area 1 at file offset 0x0000 o2, Output memory area 2 at file offset 0x0800 o3 Output memory area 3 at file offset 0x4000 Example for PIC18, line breaks and comments inserted: a1=0x000000-0x003FFF, Program flash area (16 KB) f1=RND, Fill with random bytes a2=0x200000-0x200007, Identification area f2, Fill with 0xFF a3=0x300000-0x30000F, Configuration area f3, Fill with 0xFF c=CRC32LE/0x11FC, CRC of 0x0000-0x11FB stored at 0x11FC c=CRC32LE/0x3FBC, CRC of 0x1200-0x3FBB stored at 0x3FBC c=CRC32LE/0x3FFC CRC of 0x3FC0-0x3FFB stored at 0x3FFC /sPIC18.HEX, Input "PIC18.HEX" i1,i2,i3 Input to all memory areas /dPICPROG.HEX, Output "PICPROG.HEX" t=HEX32, Format HEX32 o1,p=0x000000, Output memory area 1 using address 0x000000 o2,p=0x200000, Output memory area 2 using address 0x200000 o3,p=0x300000 Output memory area 3 using address 0x300001 /dPICPROG.P.BIN,o1 Output program binary file from area 1 /dPICPROG.I.BIN,o2 Output identification binary file from area 2 /dPICPROG.C.BIN,o3 Output configuration binary file from area 3 Example of combining two inputs, line breaks and comments inserted: a1=0x80000-0xBFFFF, Total range in EPROM (256 KB) f1, Fill with 0xFF p=0xBDA67:5, Patch the byte at 0xBDA67 to the value 5 p=0xBFFFA:0,p=0xBFFFB:0 Patch the checksum location at 0xBFFFA to 0 c=SUM16LE/ 0xBFFFA:0x80000-0xBFFFF Checksum of 0x80000-0xBFFFF stored at 0xBFFFA /sTOS.HEX,i1 Input file 1 to memory area 1 /sPRG.HEX,i1 Input file 2 to memory area 1 /dEPROM.HEX, Output "EPROM.HEX" t=HEX16, Format HEX16 r, Reduce HEX file by removing lines with 0xFF o1 Output memory area 1 to offset (address) 0 See also "adc hexview". ------------------------------------------------------------------------------- adc hexview {src} [{dst}] [/o{code}] [/n] [/u] src Source input Intel HEX file. dst Optional destination output text file. If no {dst} is used, or if {dst} is "CON", the output goes to the console and the options /o, /n and /u are ignored. /o Output character encoding of {dst}. Default is the current system Windows ANSI code page. /n Do not add a Byte Order Mark (BOM) to {dst}. /u Write Unix newlines instead of Windows newlines to {dst}. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). "adc hexview" reads any Intel HEX file and displays it in human readable form. Example of usage: adc hexview PIC18.HEX See also "adc hex". ------------------------------------------------------------------------------- adc hmake {dst} {src} ... dst Destination (target) C/C++ header file. This file should only be changed by "adc hmake". src Source input file(s). Wildcards are valid. Hidden and/or system files are ignored. ... Many source files separated with spaces may be used. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. If the source files uses Unicode BOM, the destination header file will use the same encoding. Without BOM, the current system Windows ANSI code page will be used on all files. Any BOM mismatches will give an error. The destination header file will only be written to (and get its date and time updated) if there are any changes in the file. Example of usage in a makefile for NMAKE: !if [adc hmake include\string.h string\*.asm string\*.c]!=0 !error adc hmake error !endif # "include\string.h" is now created and may be used as dependent file. Source file markers in MAK, ASM, C, C++ or C# comment lines at column 3: $hmake Start marker for lines to put in header file. $c Optional comment section to put in header file. $ End marker. The comment lines must start with "# ", "; " or " ". C++/C# comment lines using "//" cannot be used. See also "adc cmake" and "adc makelist". ------------------------------------------------------------------------------- adc http {method} {url} [/b{body}] [/c{cont}] [/s{stat}] [/r{resp}] method HTTP method to use, usually GET, HEAD or POST. url URL of http or https server. body Optional text file with the body content to send. cont Optional Content-Type of the body, default is "application/json". "; charset=utf-8" is always added to the Content-Type. stat Optional status code in response to set ERRORLEVEL 0. Default is 200. resp Optional file to write response body to. Default is to write to the console. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Sets ERRORLEVEL to: 0 Status code in response is equal to {stat} 1 Status code in response is not {stat} 2 Request error 255 Generic error Makes an HTTP request to an URL with optional body. Examples: adc http GET https://www.digsys.se/IP.aspx adc http POST https://jsonplaceholder.typicode.com/posts /bJSON.txt adc http POST 192.168.1.2:23 /bPOST.txt /c"application/x-www-form-urlencoded" adc http GET https://lists.blocklist.de/lists/all.txt /rblocklist.txt ------------------------------------------------------------------------------- adc imgconv {src} {dst} {frm} src Source input image file. dst Destination output image file. frm Optional output format: bmp, gif, jpg, png, tiff Default is to use the dst file extension or jpg if no extension match. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Converts an image file to another file with another format. Example of usage: adc imgconv inpic.bmp outpic.png ------------------------------------------------------------------------------- adc info ... [/f] ... Any command line arguments. /f Full info, including special folders. Displays information about the system and ADC. See also "adc culture" and "adc datetime". Examples: adc info . adc info ComSpec=%ComSpec% /f ------------------------------------------------------------------------------- adc log {path} [{max}] [/d] [/m] [/o{code}] [/z{zone}] [/r{form}] [/n] [/h{hide}] [/f{src}] [/e] [/t{text} ...] path Path to log file or a directory with log files. max When used, then the log file will be shrunk if it is larger than {max} kilobytes. 20% of the first (oldest) lines will be removed. /d Path is a directory with log files created by "adc log", named "YYYYMMDD.log" for each day. /m Path is a directory with log files created by "adc log", named "YYYYMM.log" for each month. See also "adc delexcess" when using /d or /m. When /d or /m is used, then usually {max} is not used. /o Output character encoding of the log file. Default is the current code page (CHCP). /z Use the time zone specified as hours from UTC, default is the local time of the system. /r C# date and time format to use in the log file, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc log" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" Default is M0. /n Append one new empty line to the log file (before /f and/or /t). Many /n may be used, for many empty lines. /h Hide the first {hide} lines of /f from being outputted to the console. The number {hide} is optional, /h alone will hide all lines. /f Source file to read and append non-empty lines to the log file. Many /f may be used, they will be appended in order. /e Use escape sequences #HHHH in {text} for Unicode characters whose code is hexadecimal HHHH. Without option /e no #HHHH are translated. /t Any text that will be appended to the log file as one line with date and time in ISO 8601 format. /t must be the last argument, everything following /t will be used as text. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is the current code page (CHCP). Useful #HHHH escape sequences in {text} when option /e is used: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Example of usage: adc log ftp.log /z0 4096 /n /n /t Starting FTP ftp -v -i -s:script.ftp>ftp.tmp adc log ftp.log /z0 /fftp.tmp /t FTP Done adc log App_Data\Log /z0 /d /oUTF8 /e /t"#0009-#0009-#0009-#0009Compile" ------------------------------------------------------------------------------- adc makelist {label} {dir} {files} {ext} {output} {except} ... label Makefile label to define in the output file. dir Directory (path) to put in front of all found files. The directory will be created if it does not exist. files File mask (with path) of files to find. Hidden and/or system files are ignored. ext Extension to change to of all found files. output File to create and write label definitions to, using the current system Windows ANSI code page. except Optional (complete) file name that should not be included. ... Many exceptions may be used. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Example of usage in a makefile for NMAKE: !if [adc makelist ASMFILES tmp *.asm obj tmp\asmfiles.mak]!=0 !error adc makelist error !endif !include tmp\asmfiles.mak The file "tmp\asmfiles.mak" will contain one line, for example: ASMFILES = tmp\file1.obj tmp\file2.obj tmp\file3.obj See also "adc cmake" and "adc hmake". ------------------------------------------------------------------------------- adc mirror {master} {slave} [{except} ...] [/c|/d|/a] [/t] [/rf|/ru|/rn] [/ne] [/f{mask}] [/u] [/e] [/p] [/b{sec}] [/sc] master Path of master (directory). slave Path of slave (directory). Directory will be created if not exist. except Optional pathname string exception. If any exception string is found in a part of a pathname, including {master} or {slave}, the file/directory is not mirrored. End with \ to match a directory. If {except} starts with {master} or {slave} (followed by a \) then the exception string is used only on master or slave paths and must match a full (rooted) path, not just any part of a pathname. This will be executed faster than not rooted exceptions. If {except} starts with "*" then two exception strings are added, with "*" replaced by {master} and {slave} respectively (followed by a \). ... Many exceptions may be used. /c Copy files from slave that are new/newer instead of prompting. /d Delete/Overwrite files on slave that are new/newer instead of prompting. /a Ask (prompt) on all actions. Without option /a then all new/newer files on the master are copied/overwritten to the slave without promting. /t Create test file "{master}\!mirror!.txt" with time stamp. /rf Use 2 seconds file time resolution in local time. For FAT16, FAT32, exFAT, ISO 9660 (CDFS), UDF and others. File times are considered equal if the file time difference is less than or equal to 2 seconds ± 1 hour daylight saving. This is the default. /ru Use 1 second file time resolution in UTC (GMT). For Unix file systems and others, e.g. Network Attached Storage (NAS). File times are considered equal if the file time difference is less than 1 second. /rn High precision 100 ns NTFS file time resolution in UTC (GMT). For NTFS partitions in Windows systems. For backward compatibility, option /h is the same as /rn. /ne Force all files to be non-equal. Files that are equal will be treated as if the master is newer. /f Only mirror files matching {mask}, with/without wildcards. No sub- directories are processed. Multiple /f may be used. /u Update existing files only. Only files that exists at both master and slave are processed. /e Pause/Prompt at errors (only). /p Always do pause/prompt at end or at errors. /b Seconds between beeps at prompts. /sc Safe but slow synchronous file copy, use for e.g. bad networks. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc mirror" will copy non-equal (changed or new) files. Files are considered equal if the file sizes and times are equal. Hidden and/or system files are not mirrored. All not hidden and not system sub-directories are processed, unless option /f. Security attributes (ACL) and alternate data streams (ADS) are not copied. If the console output is not redirected then the [ESC] key may be pressed to terminate the mirror. Examples: adc mirror D:\Doc S:\Doc /rn adc mirror G:\ E:\BACKUP_G /d /t /e adc mirror \\?\D:\ \\?\E:\Mirror\ \\?\D:\LocalData\ /ru /d /t /b6 adc mirror C:\ D:\ *Windows\ /rn See also "adc copydir". ------------------------------------------------------------------------------- adc msgbeep [/b] {sec} {msg} /b Make a beep at the beginning. sec Seconds between repeated beeps or 0 for no repeated beeps. msg Message to display, that will be erased after any key pressed. Examples of usage: adc msgbeep 6 "Press any key to continue ! " adc msgbeep /b 0 "Activate this window and press any key to close it! " ------------------------------------------------------------------------------- adc newest {file1} {file2} [{target} [...]] [/rf|/ru|/rn] file1 File 1. file2 File 2. target Copy the newest of {file1} or {file2} to {target}. If {target} is not used then "adc newest" will only display what file is the newest. ... May groups of {file1} {file2} {target} may be used. /rf Use 2 seconds file time resolution in local time. For FAT16, FAT32, exFAT, ISO 9660 (CDFS), UDF and others. File times are considered equal if the file time difference is less than or equal to 2 seconds ± 1 hour daylight saving. This is the default. /ru Use 1 second file time resolution in UTC (GMT). For Unix file systems and others, e.g. Network Attached Storage (NAS). File times are considered equal if the file time difference is less than 1 second. /rn High precision 100 ns NTFS file time resolution in UTC (GMT). For NTFS partitions in Windows systems. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc newest" will display or copy the newest of two files. Security attributes (ACL) and alternate data streams (ADS) are not copied. Example of usage in a script/batch (line breaks inserted for readability): @echo off setlocal enableextensions if not cmdextversion 2 (echo CMD extensions 2 not available!&exit /b 255) set NX0=%~nx0 adc cmdverify 1 /dC:\SYS /dS:\SYS /m"%APPDATA%\ADC" if not %errorlevel%==143 (echo ADC.EXE is not available or invalid environment!&exit /b 255) if "%~1"=="BatchCall" goto BatchCall adc newest "C:\SYS\ADC.exe" "S:\SYS\ADC.exe" "%APPDATA%\ADC\ADC.exe" "C:\SYS\ADC.exe.config" "S:\SYS\ADC.exe.config" "%APPDATA%\ADC\ADC .exe.config" "C:\SYS\%NX0%" "S:\SYS\%NX0%" "%APPDATA%\ADC\%NX0%" /rn if not %errorlevel%==0 exit /b 255 cd /D "%APPDATA%\ADC" "%NX0%" BatchCall exit /b 255 :BatchCall ... ------------------------------------------------------------------------------- adc numberlist {start} [{count}] [/h] [/u] [/i] start Start number, may include non-digit characters. Characters in {start} that are not valid digits, will be kept as is, including hexadecimal A - F of the not used upper/lower case. count Count of numbers to generate, default 100 or 256 if /h. /h Use hexadecimal numbers. Cannot be used with /i. /u Use upper case characters (A - F) in hexadecimal numbers. Default is lower case characters (a - f). /i ISO 7064 MOD 97-10 concatenated to the output. Numbers are limited to 64 bits, 0 to 18446744073709551615. Only allowed when /h is not used. Generates list of numbers, incremented by one, examples of usage: adc numberlist 00100 adc numberlist /h /u 00-20-3C-00-12-00 1024>mac.txt adc numberlist /h AbC 2 (will output "AbC" and "AcC") adc numberlist /h /u AbC 2 (will output "AbC" and "AbD") adc numberlist /i 10001- 2 (will output "10001-88" and "10002-87") ------------------------------------------------------------------------------- adc ping {host} [{num}] [{wait}] [/v] [/e] [/t{text}] [/l{log}] [/o{code}] [/z{zone}] [/r{form}] [/a] [/d] host Host IP address or name. num Optional number of pings to do, or 0 for infinite loop. Default is 4. wait Wait (delay) in milliseconds between pings, 0 to 100000. Default is 100. /v Verbose output, will display full error messages, i.e. 'PingException'. /e Exit (terminate) on first succesful ping, {num} is the maximum number of ping attempts. /t Format leading text with special $ character sequences, see below. Default is /t" ##$z ". Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. /l Write log to file {log}, default is to output to the screen only. /o Output character encoding of the log file. Default is the current code page (CHCP). /z Use the time zone specified as hours from UTC, default is the local time of the system. /r C# date and time format to use on console and log file outputs, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc ping" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" Default is M0. /a Append to the log file, keeping any existing BOM and encoding. Default is to overwrite if file exist, ignoring any existing BOM. /d {log} is a directory with log files for each day, created by "adc log" or "adc ping". The log files are named "YYYYMMDD.log". When /d is used, then usually /a is used. If both /d and /a are used, then the log file is opened and closed for each line written, to be shared by other processes. Special $ character sequences in {text}: $n Loop count with no leading or trailing spaces. $l Loop count, left-aligned with leading spaces. $z Loop count, left-aligned with leading zeros. $! Newline $$ Dollar sign $ Useful #HHHH escape sequences in {text}: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is the current code page (CHCP). Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc ping" uses the standard Ping (ICMP Echo Request). If at least one ping succeeds then ERRORLEVEL is set to 0 else ERRORLEVEL is set to 1. Press the ESC key to terminate "adc ping". The ping timeout is about 9 seconds. Examples of usage: adc ping 192.168.1.10 adc ping 192.168.1.10 1 /t" Ping " adc ping 192.168.1.10 1 /t"#0009Ping " /lApp_Data\Log /oUTF8 /z0 /a /d See also "adc tcpping" and "adc udpping". ------------------------------------------------------------------------------- adc poi {dst} {src} ... [/a{area}] [/o] [/q] dst Destination output POI file, formats: OV2, TXT src Source input POI file(s), formats: KML, GPX, OV2 Wildcards are valid. Hidden and/or system files are ignored. ... Many source files separated with spaces may be used. /a Number of POI per area, 4 - 4096, default is 32. /o Order (sort) POIs, using ordinal Unicode. /q Quiet mode, will not display POIs. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. Converts a Point Of Interest (POI) file to another file with another format. The formats are specified by the file extensions of {src} and {dst}. The output OV2 file is optimized with "skipper records", i.e. the POIs are split into areas of maximum {area} number of POI. The command "adc poi out.ov2 in.ov2" may be used as an OV2 optimizer. The POI names in OV2 uses Windows ANSI code page 1252 (ISO-8859-1). Examples of usage: adc poi tomtom.ov2 google.kml adc poi optimized.ov2 original.ov2 /a64 adc poi favorites.ov2 standard.kml holiday2014.kml /a4096 /o ------------------------------------------------------------------------------- adc pwdgen [mask] [num] [/c] [/d] mask Either a number or a character string. If a number then the length of the default password format. If a string then type of characters to generate: a Alphanumeric: 0-9, a-z d Digit: 0-9 h Hexadecimal digit: 0-F l Letter: a-z v Vocal: a e i o u y c Consonant: b c d f g h j k l m n p q r s t v w x z * All in lower and upper case, except symbols # All with usable symbols (punctuations) num Number of passwords to generate, default 10. /c No consecutive duplicates. /d No duplicates at all. Generates passwords. Examples of usage: adc pwdgen 12 adc pwdgen cvccvc adc pwdgen hhhhhhhhhh 8 adc pwdgen laaaaaaaaaaa /c adc pwdgen ************ /d ------------------------------------------------------------------------------- adc qsort {path} ... [/l] [/c{cult}] [/i{code}] [/o{code}] [/n] [/u] [/s] [/d] [/q] [/v] path Pathname to files, wildcards are valid. Hidden and/or system files are ignored. ... Many pathnames separated with spaces is allowed. /l Case insensitive sort, ignoring upper/lower letters. /c Use the culture {cult} for sorting, see "adc culture". Default is to use ordinal character codes. /i Default input character encoding to use when there is no existing BOM in a file. Default is the current system Windows ANSI code page. /o Forced output character encoding to always use. Default is to keep a files encoding as is. /n Do not add a Byte Order Mark (BOM) to the files. /u Write Unix newlines instead of Windows newlines. /s Sort found files in sub-directories also. /d Delete duplicate lines. /q Quiet mode, will not display files. /v Verbose mode, will also display number of lines and execution time. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). "adc qsort" does not do heuristic encoding detection, it only checks for any Byte Order Mark (BOM) in the beginning of the files. Examples: adc qsort data.txt /cen-US ------------------------------------------------------------------------------- adc rencase {path} ... [/s] [/l|/u] [/d|/b] [/c{cult}] [/x] path Pathname to a directory or a file, wildcards are valid. ... Many pathnames separated with spaces is allowed. /s Search in subdirectories also. /l Rename file names to lower case. /u Rename file names to upper case. /d Rename only directories. By default only files are renamed. /b Rename both files and directories. /c Use the culture {cult} for upper/lower characters, see "adc culture". If /c alone (no {cult}) then the current user default culture is used. Without option /c the invariant culture is used. /x Execute rename. Without option /x, the files and directories are only displayed and not renamed. Only when /x is used will they be renamed. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. ------------------------------------------------------------------------------- adc search {path} {srch} [/i{code}] [/l] [/c{cult}] [/r] [/s] [/v] [/q] [{rplc}] [/o{code}] [/n] [/u] [/x] path Pathname to files, wildcards are valid. Hidden and/or system files are ignored. srch Text to search, use " if spaces or other special characters such as ^ or |. Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. /i Default input character encoding to use when there is no existing BOM in a file. Default is the current system Windows ANSI code page. /l Case insensitive search, ignoring upper/lower letters. /c Use the culture {cult} for upper/lower letters, see "adc culture". If /c alone (no {cult}) then the current user default culture is used. Without option /c the invariant culture is used. /r Use C# regular expression, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ regular-expression-language-quick-reference Escape sequences #HHHH are processed before the C# regular expression. /s Search found files in sub-directories also. /v Verbose output, will display all found lines. /q Quiet mode, will not display anything. rplc Optional. When used, all found {srch} sequences will be replaced with {rplc}, and written to the files if /x is used. Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. The options below are only used when replacing: /o Forced output character encoding to always use. Default is to keep a files encoding as is. /n Do not add a Byte Order Mark (BOM) to the files. /u Write Unix newlines instead of Windows newlines. /x Execute replaces. Without option /x, the replaces are only displayed but no files are modified. Only when /x is used files will be modified. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). Sets ERRORLEVEL to: 0 No found lines. 1 One line found. 2 Two lines found. . . 253 253 lines found. 254 254 or more lines found. 255 Generic error. "adc search" does not do heuristic encoding detection, it only checks for any Byte Order Mark (BOM) in the beginning of the files. The search (and replace) is done within single lines, accepting Windows, Unix, Mac Classic or inconsistent newlines characters. The Unicode characters #000A and #000D will never be found if used in the search string. Without the options /v and /q, then only found file names are displayed, useful for script/batch processing. Useful escape sequences: #0009 Tab character #0022 Quotation mark " #0023 Number sign # #0025 Percent sign % #0026 Ampersand & #002F Forward slash / #003C Less-than sign < #003E Greater-than sign > #005E Caret ^ #007C Pipe | ## Number sign # Examples: adc search *.txt /s my@email.com adc search data.tab #0009 , adc search *.txt /s /r "old(\w*)@email.com" "new$1@email.com" /x ------------------------------------------------------------------------------- adc sendmail {label}={value} ... /e{code} /t{trans} /h /s label Label of parameter to set. See below. value Value of parameter to set. See below. Use " if value has spaces. ... Many "{label}={value}" may be used. /e Encoding of subject and body, default depends on message. /t Transfer-Encoding, default depends on /e. Option /t requires .NET Framework 4.5 or later. /h Message body is in HTML, default is plain text. /s Use STARTTLS Label of parameters: from Message author to Message recipient, start with @ to read from a text file subj Subject of message reply Mailbox for replies to message sender Message sender cc Carbon-copy recipient, start with @ to read from a text file bcc Blind-carbon-copy recipient, start with @ to read from a text file body Message text, start with @ to read from a text file host Host address of SMTP server, default is "localhost" port Port of SMTP server, default is 25 user User name of SMTP server, default is no credentials pass Password of SMTP server, default is no credentials Multiple to, cc and bcc may be used. When reading addresses from a file, they may be separated by whitespaces, newlines or commas. Lines starting with semicolon ; or number sign # are ignored (comment lines). Multiple body may be used. When reading body text from a file, the entire file is used as is, excluding any BOM. The current system Windows ANSI code page will be used on all read files without BOM. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). The default encoding of subject and body is 7-bit US-ASCII, unless non-ASCII characters are used, then the default encoding is UTF-8. {trans} is one of (option /t requires .NET Framework 4.5 or later): 7Bit Unencoded 7-bit US-ASCII, see RFC 2406 Section 2.7. 8Bit 8-bit extended ASCII, see RFC 6152. Base64 Base64 encoding, see RFC 2406 Section 6.8. QP Quoted-Printable encoding, see RFC 2406 Section 6.7. The default transfer encoding is Quoted-Printable, unless any UTF encoding (except UTF32BE) is used, then the default transfer encoding is Base64. Examples (line breaks inserted for readability): adc sendmail from=me@gmail.com to=you@gmail.com subj="Hello you!" body="@C:\Path\Body.txt" host=localhost ------------------------------------------------------------------------------- adc sleep {ms} [{loop}] [{file}] [{except} ...] [/u] ms Milliseconds to sleep (in each loop). loop Optional loop count while file exists and user has not pressed [ESC]. file Optional file to check, wildcards are valid, terminates with ERRORLEVEL 1 when no files or directories exists. except Optional name string exception. If a found file name is equal to the exception string, the file is ignored as if it does not exist. ... Many exceptions may be used. /u Enable user [ESC] key, terminates with ERRORLEVEL 2 if user press the [ESC] key. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. The check for file existence and/or [ESC] key is only done once in each loop. When time is up, file exist and no user [ESC] key, ERRORLEVEL is set to 0. Example of usage in a script/batch: echo Will wait up to 1 hour. Press the [ESC] key to terminate. adc sleep 100 36000 D:\Script\*.bsy server.bsy /u See also "adc waitfile". ------------------------------------------------------------------------------- adc sound {sound} [{silent}] [{loop}] [/u] sound Path to a WAV file to play, or if the first character is * then play the WAV file defined in the registry at: HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\{sound}\.Current Typical registry entries are: CriticalBatteryAlarm, DeviceConnect, DeviceDisconnect, DeviceFail, LowBatteryAlarm, MailBeep, SystemAsterisk, SystemExclamation, SystemExit, SystemHand, SystemNotification, SystemQuestion, SystemStart, WindowsLogoff, WindowsLogon. Use a single "*" to get a list of all registry entries for the current user. silent Milliseconds to wait while silent after the sound has been played. loop Loop count to repeat {sound} and {silent}. /u Enable user [ESC] key, terminates with ERRORLEVEL 2 if user press the [ESC] key. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc sound" plays a sound from a WAV file or a Windows system sound. Examples: adc sound * adc sound *SystemAsterisk 1000 adc sound MySound.wav 2000 10 /u ------------------------------------------------------------------------------- adc stopwatch {mode} {file} {sec} [/v] [/q] mode Mode, one of: start Start stopwatch, will create and write to the {file}. stop Stop stopwatch, will get the time of the {file} and then delete it. Compare with {sec}. time Get the time of the {file} and compare with {sec}. May be used on any file to compare the time since the file was written to. file File to use by the stopwatch. sec Compare time. If more seconds has gone since {file} was created or written to, ERRORLEVEL will be set to 1. {sec} may only be used with 'stop' and 'time'. {sec} may be a decimal number. /v Verbose output. /q Quiet mode (no output). Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc stopwatch" will measure the time between start and time/stop, useful for performance measure in script/batch. Examples of usage in script/batch files (line breaks inserted for readability): @echo off adc stopwatch start C:\Stopwatch /v adc compdir D:\Data D:\Backup /h /c adc stopwatch stop C:\Stopwatch /v @echo off adc stopwatch start C:\TMP\Stopwatch adc compdir D:\Data D:\Backup /h /c set T=ERROR for /F "usebackq tokens=* delims=" %%A in (`adc stopwatch stop C:\TMP\Stopwatch`) do set T=%%A echo Execution time: %T% ------------------------------------------------------------------------------- adc tcpping {host} {port} [{num}] host Host IP address or name. Use SERVER to start a TCP Ping server that will answere to clients on all network interfaces, supporting both IPv4 and IPv6. port TCP port number. num Optional number of pings to do, or 0 for infinite loop. Default is 4. Press the ESC key to terminate UdpPing. "adc tcpping" is similar to the standard Ping (ICMP Echo Request), but uses only TCP. The host must be aware of this non-standard usage of TCP. "adc tcpping" sends an TCP with eight bytes of data, four bytes with the characters "PING" and four bytes with a 32-bit integer loop counter. The host replies with the same data. Transmit and receive timeouts are 20 seconds. Example of usage: adc tcpping 192.168.1.10 17552 adc tcpping server 17552 adc tcpping digsys.se 14300 16 adc tcpping ::ffff:c000:280 0x10F0 0 See also "adc ping" and "adc udpping". ------------------------------------------------------------------------------- adc terminal serial {port},{baud},{data},{par},{stop},{cts},{dsr},{rts},{dtr} [/net] adc terminal socket {host},{port},{ssl},{srv},{rev},{pfx},{pwd} [/c] [/m] Common options: [/e] [/w] [/0] [/r{code}] [/l{log}] [/o{code}] [/n] [/a] [/t[{form}]] [/z{zone}] port Serial port name, e.g. COM1, without any ':'. Use * to get a list of all registred serial ports from "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM", all other arguments and options are ignored. baud Baud rate: 50-4000000. Default 115200 bps. data Data bits: 7 or 8. Default 8 data bits. par Parity: N, O, E, M or S. Default no parity (N). stop Stop bits: 1 or 2. Default 1 stop bit. cts CTS handshake on (H) or not (N). Default N. dsr DSR handshake on (H) or not (N). Default N. DSR handshake (H) is only available with option /x. rts RTS enable (E), disable (D) or handshake (H). Default E or H. RTS E and D is only available with option /x or when CTS is N. dtr DTR enable (E), disable (D) or handshake (H). Default E. DTR handshake (H) is only available with option /x. /net Use .NET Framework for serial communication. host Host name or IP address of remote. Use * to start a TCP server that will answere to clients on all network interfaces, supporting both IPv4 and IPv6. port TCP port number to use, default is 23 (Telnet). ssl SSL/TLS protocol, one of: NOSSL No SSL/TLS protocol is used (default). NETSSL .NET Framework default SSL/TLS protocol. SSL2 SSL 2.0 protocol. SSL3 SSL 3.0 protocol. TLS10 TLS 1.0 protocol. TLS11 TLS 1.1 protocol, only .NET Framework 4.5 or later. TLS12 TLS 1.2 protocol, only .NET Framework 4.5 or later. srv Server name of {host} in certificates. Default {host}. rev Check certificate revocation list (R), or not (N). Default N. pfx Path and name of a PFX file. Default no personal ceritificates. pwd Password of the PFX file. Default no password. /c Enable Telnet "Interpret As Command" (IAC), including RFC-2217 Telnet Com Port Control Option. /m Multiple sessions, does not exit after a port is closed. /e Echo by remote, default is local echo. /w Send newline sequence "\r\n" on Enter key, default is to send "\r" only. /0 Send newline sequence "\r\x00" on Enter key. /r Character encoding of the remote. Default is the current system Windows ANSI code page. /l Output text to file {log}, default is to output to the screen only. /o Character encoding of the output file {log}. Default is the same encoding as /r. /n Do not add a Byte Order Mark (BOM) to the output file {log}. /a Append to the output file {log}, keeping any existing BOM and encoding. Default is to overwrite if file exist, ignoring any existing BOM. /t Start all lines with date and time. The optional {form} is the C# date and time format to use, see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ standard-date-and-time-format-strings Use the escape sequence #HHHH for Unicode characters whose code is hexadecimal HHHH. Escape sequences #HHHH are processed first. Additional format specifiers used by "adc dr" only: C0 "yyyyMMddHHmmss" C1 "yyMMddHHmmss" C2 "yyyyMMdd'.'HHmmss" C3 "yyMMdd'.'HHmmss" L0 "yyyy'-'MM'-'dd HH':'mm':'ss" L1 "yy'-'MM'-'dd HH':'mm':'ss" M0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fff" M1 "yy'-'MM'-'dd HH':'mm':'ss'.'fff" H0 "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff" H1 "yy'-'MM'-'dd HH':'mm':'ss'.'fffffff" Default is M0. /z Use the time zone specified as hours from UTC, default is the local time of the system. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is the current code page (CHCP). Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc terminal" transmits and receives characters via a serial port or TCP/IP. Examples: adc terminal serial * adc terminal serial COM1,115200,8,N,1 adc terminal serial CNCB1,19200,8,N,1,H,N,H,D adc terminal socket 192.168.47.8,23 /e adc terminal socket *,23 /m adc terminal socket digsys.se,80 /w adc terminal socket google.com,443,TLS12 /w ------------------------------------------------------------------------------- adc test {no} no Any number to set ERRORLEVEL to. Typical usage in a script/batch to verify that ADC is installed and available: @echo off setlocal enableextensions if not cmdextversion 2 (echo CMD extensions 2 not available!&exit /b 255) adc test 143 if not %errorlevel%==143 (echo ADC.EXE is not available!&exit /b 255) ... See also "adc cmdverify". ------------------------------------------------------------------------------- adc textmake {src} {dst} {first} {begin} {val} {sep} {end} {last} [/p{proc}] [/l{num}] [/m] [/i{code}] [/o{code}] [/n] [/u] src Source input file. dst Destination output text file (usually ASM, C, C++, C#, Perl, HTML). If {dst} is "CON", the output goes to the console and the options /m, /o, /n and /u are ignored. first Output text of first line before first value. begin Output text at the beginning of internal lines with values. val Output text to use on each value. sep Output text to use between (separate) each value. end Output text at the end of internal lines with values. last Output text of last line after last value. /p Process the input {src} file using method {proc}, see below. /l Number of values per line, separated by a comma. Default is 16. /m If {dst} exist then write in memory and compare with {dst} if it needs to be updated. When option /m is used, the {dst} file will only be written to (and get its date and time updated) if there are any changes in the file. /i Default input character encoding to use when there is no existing BOM in {src} or {dst}. Default is the current system Windows ANSI code page. Used for {dst} when option /m is used, or on {src} when option /pLINES is used ({src} is a text file). /o Forced output character encoding of {dst}. If option /m is used then the default is to keep the encoding as is or as option /i. Else if option /pLINES is used then the default is the use the same encoding as {src}. Else the default is the current system Windows ANSI code page. /n Do not add a Byte Order Mark (BOM) to {dst}. /u Write Unix newlines instead of Windows newlines. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {proc} is one of: <bytes> Generic binary file, <bytes> is a number 1 to 8 specifying the number of bytes per value. E.g. /p1 will get bytes (8-bits) and /p4 will get DWORDs (32-bits). The first value is at file location 0. /p1 is the default if option /p is not used. BMP8 Image file to BMP. The source input file should be an image file of type BMP, GIF, JPG, PNG or TIFF. The image will be converted to a Windows bitmap byte array. Each byte is then outputed as a value in the output text {val}. The first byte values are at the upper/left corner, and each scan line is aligned (padded) to 8 bits. BMP16 Same as BMP8 but with 16 bit alignment. BMP32 Same as BMP8 but with 32 bit alignment. BMP64 Same as BMP8 but with 64 bit alignment. LINES Each value in the output text {val} is a text line from {src}. End of line sequences are removed. It accepts Windows, Unix, Mac Classic or inconsistent newlines characters. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). "adc textmake" converts a binary file to text files. The output texts {first}, {begin}, {val}, {sep}, {end} and {last} are outputted (written) in the following manner (line breaks inserted for readability): {first} {val} {sep} {val} {sep} ... {val} {sep} {val} {end} {begin} {val} {sep} {val} {sep} ... {val} {sep} {val} {end} ... {begin} {val} {sep} {val} {sep} ... {val} {sep} {val} {end} {begin} {val} {sep} {val} {sep} ... {val} {sep} {val} {last} The output texts are strings with C# composite format items, syntax "{index[,align][:format]}", see: https://learn.microsoft.com/en-us/dotnet/standard/base-types/ composite-formatting C# composite format items as examples: {0} Translates to the newline sequence {1} Translates to the character: % {2} Translates to the character: $ {3} Translates to the character: " {4} Translates to the character: > {5} Translates to the character: < {6} Translates to the character: | {7} Translates to the character: ^ {8} Translates to the character: { {9} Translates to the character: } {10} Translates to command line used {11:X2} Value in two uppercase hexadecimal digits {12:X4} Line offset in four uppercase hexadecimal digits {13:D} Number of values (in decimal digits) {14:D} Image width {15:D} Image height {16:D} Image bits per pixel Note, normally "{0}" is used in the output texts {end} and {last}, otherwise no line breaks will be outputted. Example of usage (line breaks inserted for readability): adc textmake data.bin data.asm /l8 "Data_Bytes EQU {2}{0} DB " " DB " "0x{11:X2}" "," " ;0x{12:X4}{0}" " ;0x{12:X4}{0}Data_Size EQU {13:D}{0}" Result in file "data.asm" (not all lines shown): Data_Bytes EQU $ DB 0xE6,0xF0,0x60,0xFA,0x9A,0xB7,0xFE,0x70 ;0x0000 DB 0xA4,0x00,0xB2,0xFE,0x7E,0xB7,0x86,0xF0 ;0x0008 ... (lines skipped) DB 0xFF,0x00,0x87,0x78,0x87,0x87,0xCC,0x00 ;0x0488 DB 0x00,0x00,0x00,0x00,0x25 ;0x0490 Data_Size EQU 1173 Example of usage (line breaks inserted for readability): adc textmake image.bmp image.c /l12 /pBMP8 "#define Width {14:D}{0} #define Height {15:D}{0} #define BPP {16:D}{0} unsigned char Bytes[{13:D}]={8}{0}" "" "0x{11:X2}" "," ",{0}" "{9};{0}" Result in file "image.c" (not all lines shown): #define Width 151 #define Height 26 #define BPP 1 unsigned char Bytes[494]={ 0x7F,0xE1,0xFF,0xF3,0xFF,0x9F,0xFC,0xE0,0x07,0xFF,0xC0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF1,0xFF,0xF3,0xFF, ... (lines skipped) 0x38,0x0E,0x01,0xC3,0xFF,0x07,0x0F,0x0E,0x3F,0xFE,0x70,0x1F, 0x01,0xC0}; Example of usage (line breaks inserted for readability): adc textmake lines.txt lines.cs /pLINES /l5 "new String[{13:D}] {8}{0}" "" "{3}{11}{3}" ", " ",{0}" "{9};{0}" Result in file "lines.cs": new String[10] { "Line 1", "Line 2", "Line 3", "Line 4", "Line 5", "Line 6", "Line 7", "Line 8", "Line 9", "Line 10"}; ------------------------------------------------------------------------------- adc textproc {src} {dst} {name}={value} ... [/c{chr}] [/e{esc}] [/m] [/i{code}] [/o{code}] [/n] [/u] src Source input text file. dst Destination output text file. If {dst} is "CON", the output goes to the console and the options /m, /o, /n and /u are ignored. name Variable define, defines 'name' to 'value'. value Value for the variable 'name'. ... Many defines may be used. /c Token character. Use a single character, or a Unicode number. Default is /c# or /c35. Use for example /c` or /c96 when # cannot be used, as in C/C++/C#/Perl source code files. It cannot be a name character. /e Additional characters that will be escaped by "#name\#" and "#strinc", default is only the characters: ' " \ This is good for C/C++/C#. For Perl use: /e$@ /m If {dst} exist then write in memory and compare with {dst} if it needs to be updated. When option /m is used, the {dst} file will only be written to (and get its date and time updated) if there are any changes in the file. /i Default input character encoding to use when there is no existing BOM in {src}. Default is the current system Windows ANSI code page. /o Forced output character encoding of {dst}. If option /m is used then the default is to keep the encoding as is. If not option /m or if no BOM in {dst} then the default is to use the same encoding as {src} or option /i. /n Do not add a Byte Order Mark (BOM) to {dst}. /u Write Unix newlines instead of Windows newlines to {dst}. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). "adc textproc" process text files with conditions and variables, similar to that the C/C++ preprocessor does. It accepts Windows, Unix, Mac Classic or inconsistent newlines characters. Line directives (the line is removed in the destination file): #define name value Set 'name' to 'value', use " or # if spaces. #undef name Undefine 'name'. #ifdef name Process following lines only if 'name' is defined. #else Else statement for conditional processing. #endif End of conditional processing. #ifndef name Process lines only if 'name' is not defined. #include "file" Include file and read Line directives only. Good for C/C++ header files. #textinc "file" Include file and process Line and Text directives. #strinc "file" expr Include file and process Line and Text directives, and make C/C++/C#/Perl strings with escape sequences. All #strinc# in 'expr' will be replaced by a line from the file. 'expr' will be processed for all lines. Text directives (the token is replaced in the destination file): #name# Replace #name# with the value of 'name'. #name\# Replace to value of 'name' using escape sequences. #c Escapes any character c except name characters. Using e.g. "#\" will result in "\" even if it is done in a file to "#strinc", that normally would escape "\" to "\\". Example of usage: adc textproc perl.pls perl.pl /c96 /e$@ ------------------------------------------------------------------------------- adc touch {path} ... [/f{file}] [/d[YYYY-MM-DD]] [/t[HHMM]] [/s] path Pathname to files, wildcards are valid. Hidden and/or system files are ignored. ... Many pathnames separated with spaces is allowed. /f File to get date & time from, instead of the current system date & time. /d Date to use, in ISO 8601 format YYYY-MM-DD. Time is set to 12:00:00.0000000 UTC±00:00. If only /d without YYYY-MM-DD then the date is kept as is. /t Hours and minutes to use, seconds and parts of seconds are cleared. If only /t without HHMM then hours and minutes are kept as is. /s Touch found files in sub-directories also. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. "adc touch" sets the create, last-access and last-write dates and times of the specified files. By default it will use the current system date and time. ------------------------------------------------------------------------------- adc trim {path} ... [/i{code}] [/o{code}] [/n] [/u] [/t] [/s] [/a] path Pathname to files, wildcards are valid. Hidden and/or system files are ignored. ... Many pathnames separated with spaces is allowed. /i Default input character encoding to use when there is no existing BOM in a file. Default is the current system Windows ANSI code page. /o Forced output character encoding to always use. Default is to keep a files encoding as is. /n Do not add a Byte Order Mark (BOM) to the files. /u Write Unix newlines instead of Windows newlines. /t Filter tabs to spaces also. /s Trim found files in sub-directories also. /a Automatic options depending on found file names or extensions. Files with not supported names or extensions are skipped (ignored). Options /i, /o and /n are ignored. See below. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF8 UTF-8. UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is current code page (CHCP). Automatic options (/a) for different file extensions: /iOEM /oOEM cmd bat /iUTF8 /oUTF8 /n css js htm html /iUTF8 /oUTF8 manifest resx wxs wxi wxl /iANSI /oUTF8 ashx aspx cs master config /iANSI txt lkr mak asm inc c cpp h hpp cxx def hpj ini rc rtf cmt cfg set new ver Automatic options (/a) for different file names (with extension): /iANSI makefile "adc trim" does not do heuristic encoding detection, it only checks for any Byte Order Mark (BOM) in the beginning of the files. By default, "adc trim" will for each found file, read all lines, accepting Windows, Unix, Mac Classic or inconsistent newlines characters, filter control and whitespace characters to ordinary spaces, remove trailing whitespaces and then write all lines using Windows or Unix newlines to the same file. The only outputted whitespace and control characters are the newlines, spaces and tabs. Examples: adc trim *.txt /s adc trim /s /t /iUTF8 /oUTF8 *.ashx *.aspx *.cs *.master *.config adc trim /s /t /iUTF8 /oUTF8 /n *.css *.js *.htm *.html adc trim /s /t /oOEM robots.txt *.cmd *.bat adc trim /s /t /a D:\SDS\PJT\ ------------------------------------------------------------------------------- adc txtcode {src} [{dst}] [/i{code}] [/o{code}] [/n] [/c] src Source text file. dst Destination text file. If {dst} is not used, BOM information about {src} will be displayed. /i Input character encoding of the source file. A warning will be displayed if there is a mismatch in an existing BOM. /iAUTO will use the current system Windows ANSI code page if no BOM exists. /o Output character encoding of the destination file. Default is UTF8. /oAUTO is the same as /oANSI (current system Windows ANSI code page). /n Do not add a Byte Order Mark (BOM) to the destination file. /c Display all code pages in the system and ignore all other options. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. {code} is one of: AUTO Detect by BOM or use ANSI code page (default for input source). ANSI Current system Windows ANSI code page. OEM Current system OEM code page. UTF7 UTF-7 (BOM not supported). UTF8 UTF-8 (default for output destination). UTF16LE UTF-16 Little Endian (Windows). UTF16BE UTF-16 Big Endian (Unix). UTF32LE UTF-32 Little Endian (Windows). UTF32BE UTF-32 Big Endian (Unix). <cp> Code page number <cp>. 0 is the current code page (CHCP). "adc txtcode" does not do heuristic encoding detection, it only checks for any Byte Order Mark (BOM) in the beginning of the input file. Examples: adc txtcode checkme.txt adc txtcode ansi.txt oem.txt /oOEM adc txtcode /c ------------------------------------------------------------------------------- adc udpping {host} {port} [{num}] host Host IP address or name. Use SERVER to start a UDP Ping server that will answere to clients on all network interfaces, supporting both IPv4 and IPv6. port UDP port number. num Optional number of pings to do, or 0 for infinite loop. Default is 4. Press the ESC key to terminate UdpPing. "adc udpping" is similar to the standard Ping (ICMP Echo Request), but uses only UDP. The host must be aware of this non-standard usage of UDP. "adc udpping" sends an UDP with four bytes of data (a 32-bit integer loop counter). The host replies with the same data. Transmit and receive timeouts are 20 seconds. Example of usage: adc udpping 192.168.1.10 16050 adc udpping server 16050 adc udpping digsys.se 14300 16 adc udpping ::ffff:c000:280 0x10F0 0 See also "adc ping" and "adc tcpping". ------------------------------------------------------------------------------- adc validarg {level} {length} ... level Level of validation of the arguments on the command line. length Length limit 1-32767, maximum length of each argument, e.g. 300. ... Any number of arguments. The standard adc command line interpretation is used, i.e. " is used to include spaces. {level} is one of: 0 All characters are valid except: ctrls " < > | 1 As 0, plus the invalid chars: spaces & ^ 2 As 1, plus the invalid chars: ( ) ; , ' ` 3 As 2, plus the invalid chars: [ ] { } @ = ! + ~ Example of usage in a batch/script: @echo off adc validarg 3 300 %* if not %errorlevel%==0 goto error ... ------------------------------------------------------------------------------- adc waitfile {ms} {loop} {file} [{except} ...] [/u] ms Milliseconds to sleep (in each loop). loop Loop count while file not exists and user has not pressed [ESC]. file File to check, wildcards are valid, terminates with ERRORLEVEL 0 when files or directories exists. except Optional name string exception. If a found file name is equal to the exception string, the file is ignored as if it does not exist. ... Many exceptions may be used. /u Enable user [ESC] key, terminates with ERRORLEVEL 2 if user press the [ESC] key. Use "\\?\D:\Path" or "\\?\UNC\Server\Share\Path" for long paths. The check for file existence and/or [ESC] key is only done once in each loop. When time is up, no file exist and no user [ESC] key, ERRORLEVEL is set to 1. Example of usage in a script/batch: echo Will wait up to 1 hour. Press the [ESC] key to terminate. adc waitfile 100 36000 D:\Reply.txt /u See also "adc sleep". -------------------------------------------------------------------------------

Version

Version history of ADC Version: Date (ISO): Comments: 1.0.0.14 2012-11-22 First public release. 1.0.0.15 2012-11-30 The Win32 'CopyFile()' function is no longer used, due to Windows 8 and Windows Server 2012 now also copies the security attributes (ACL). Clarified the help about security attributes (ACL) of the commmands: "adc cond", "adc mirror" and "adc newest". 1.0.0.16 2012-12-03 Bugfix of files larger than 2 GB. 1.0.0.17 2012-12-09 Added "adc cmdverify". Improved "adc newest". 2012-12-10 Remove files by number of days in "adc delexcess". 2012-12-12 Options /rf, /ru and /rn added to the commands "adc compdir", "adc mirror" and "adc newest" to support FAT, UNIX and NTFS file time resolutions. 2012-12-13 Added "adc sound". 2012-12-22 Improved internal 'CopyFile()' function to use asynchronous file I/O. Added options /nc and /a to the command "adc mirror". 1.0.0.18 2013-01-08 "adc mirror" will now overwrite read-only files. 1.0.0.19 2013-01-20 Bugfix of " and \ usage in "adc get". 2013-02-12 Removed option /nc from the command "adc mirror". 2013-02-13 Added option /ne to the command "adc mirror". 1.0.0.20 2013-03-16 "adc search" now uses escape sequences #HHHH. 2013-03-18 "adc stopwatch" will now use Last Write Time as intended and not Last Access Time. 1.0.0.21 2013-03-21 Added option /m to the command "adc terminal". 2013-03-25 The internal 'CopyFile()' will now try to delete the destination (target) file on file copy errors. Added Ctrl+A as abort after ESC is pressed during file copy in "adc mirror". Timeout of asynchronous file I/O increased from 20 seconds to 1 hour (for large files over slow VPN). 2013-03-30 New command "adc poiconv". 2013-04-28 Minor fixes. 1.0.0.22 2013-06-02 Added option /q to "adc search". 2013-07-22 Bugfix of internal exception when BOM was written in "adc textmake" and "adc textproc". 1.0.0.23 2013-07-25 Added argument {time} to the command "adc errexist". 2013-10-01 Added option /v to "adc search", changed option /q, displayed output and ERRORLEVEL. 1.0.0.24 2013-11-01 New command "adc hexview". 2013-11-10 Improved "adc hex" option "d#={dynamic}". 2013-11-18 Prevents idle timeouts during executions. 2013-11-21 Added option /d to "adc touch". 1.0.0.25 2014-01-13 Recompile with Visual Studio 2013 and Windows 8.1. 2014-01-19 Added option /x to "adc terminal". 2014-02-10 Bugfix of "access denied" when file or device permission was not "full control". 1.0.0.26 2014-02-21 Added format "H0" and #HHHH escape sequences to "adc datetime". 2014-02-27 New syntax and improved "adc dr". 1.0.0.27 2014-06-04 Renamed "adc poiconv" to "adc poi". New syntax and improved "adc poi". 2014-06-11 Changed the argument {time} to an option and added the argument {except} to the command "adc errexist". 1.0.0.28 2014-12-04 Improved internal file handling. 2015-03-17 Increased "adc ftpsend" timeouts. 1.0.0.29 2015-03-24 Added option /t to "adc ping". 2015-04-04 Added TXT output of "adc poi". 2015-05-22 Improved internal file handling. Added "ProgramW6432" to "adc cmdverify". 2015-07-01 "adc mirror" verifies that at least one file/directory exists in the master path. 1.0.0.30 2015-07-29 Added log options to "adc ping". 2015-08-09 New command "adc copydir". 2015-08-14 New command "adc waitfile". 2015-08-16 Added option /m to "adc cmdqueue". 2015-08-19 New command "adc between". 1.0.0.31 2015-10-22 Added option /o to "adc log". 2015-12-10 Updated "ADC.ReadMe.txt" about .NET Framework 4.5.2, 4.6 and 4.6.1. 1.0.0.32 2016-04-09 Added option /e to "adc log". 1.0.0.33 2016-06-30 Added option /h to "adc copydir". 2016-07-07 Handle files larger than 1.5 GB in "adc bom" and in "adc search" when not replacing. 2016-07-15 Bugfix of "adc frm E" when using a destination path. 1.0.0.34 2017-03-17 Internal changes and improvements. 1.0.0.35 2017-05-17 "adc cmdverify" now uses option /o for "APPDATA". 1.0.0.36 2017-05-23 Added option /e to "adc daynumber". 2017-06-11 Removed file size limit in "adc ftpsend". 1.0.0.37 2017-08-11 Added the Adler-32 checksum and execution time measurements in "adc crc". 2017-08-31 Improved internal file handling. 1.0.0.38 2017-11-15 Added option /m to "adc copydir". 2017-12-12 "adc sound" will now handle "empty" registry sounds. 2017-12-19 "adc delall" will now continue on delete errors. Added option /a to "adc delall". 2018-01-10 Uses ZIP instead of self-extracting archive. 1.0.0.39 2018-02-21 Added option /d to "adc ping". Added option /t and /d to "adc ftpsend". 2018-03-18 New command line syntax for "adc terminal", with support of SSL/TLS and RFC-2217. 1.0.0.40 2018-03-20 Improved internal serial communication. 2018-04-15 Added option /m to "adc log". 2018-05-23 Added format sequences $k, $m, $g and $t to "adc dr". 2018-05-26 Added option /y to "adc ftpsend". 2018-10-06 Internal changes and improvements. 1.0.0.41 2018-10-09 Added option /a to "adc trim". 1.0.0.42 2019-03-04 New command "adc http". 2019-08-26 Internal changes and improvements. 1.0.0.43 2019-09-11 Improved internal 'CopyFile()' function. Abort key [Ctrl]+[A] changed to [Ctrl]+[Z] due to new console keys in Windows 10. 1.0.0.44 2019-10-25 Internal changes and improvements. 2020-01-21 New command line syntax for "adc terminal". 1.0.0.45 2020-01-24 Added pathname string exceptions to "adc delall". 2020-01-31 Added option /b to "adc msgbeep". 2020-02-05 Changed option /y of "adc ftpsend". 2020-02-09 Added option /v to "adc stopwatch". New output format of "adc stopwatch". 2020-02-13 New command "adc delsame". 2020-04-02 Added option /sc to "adc copydir" and "adc mirror", for safe synchronous file copy over bad networks. 2020-04-04 More date formats in "adc dr" and "adc datetime". 2020-04-07 Added "adc fileinfo". 2020-04-09 Added "adc filter". 2020-04-13 Added option /d to "adc qsort". New syntax and improved "adc http". 2020-04-14 Added "adc blacklist". 2020-04-15 Added "adc addlines". 1.0.0.46 2020-05-21 Added "adc sendmail". 2020-07-16 Added support of .NET Framework 4.8 for Windows 10 Version 2004. 1.0.0.47 2020-11-11 Added "adc tcpping". Improved "adc udpping". 1.0.0.48 2020-11-30 "adc terminal" option /x replaced with /net. 2020-12-09 Added "adc firmflash". 2020-12-13 Added option /i to "adc numberlist". 1.0.0.49 2020-12-21 "adc terminal" now supports the characters backspace (ASCII 8) and bell (ASCII 7). 2020-12-29 New date & time formats added to "adc datetime" and "adc dr". 2020-12-30 New default log date & time format, and option /r for log date & time formats added to "adc cmdqueue", "adc ftpsend", "adc log" and "adc ping". "adc terminal" option /t may also specify date & time format to use. New default date & time format. 2020-12-31 New timespan format using milliseconds in "adc ftpsend" and "adc stopwatch". 2021-01-03 Version released. 1.0.0.50 2021-01-12 "adc blacklist" option /d renamed to /k. Added log output in "adc blacklist". Changed console and log output format of "adc ping". 2021-02-14 Explicitly waiting for TCP FIN on socket closes. 2021-02-19 Added options {wait} and /e to "adc ping". 1.0.0.51 2021-03-22 Improved "adc http". 2021-03-31 New output format of "adc ping". 1.0.0.52 2021-04-20 Internal changes and improvements. 2021-06-11 Improved "adc cond" with equality check and output format. 2022-01-12 Version released. 1.0.0.53 2022-06-04 "adc ping" option /v added. Default is now to not show full "PingException" error messages. 2022-07-06 Added support of Windows 11 in "adc info". 2023-01-13 Version released. 1.0.0.54 2023-02-09 "adc blacklist" changed and improved, multiple options /b{black} and /w{white} can now be used. 2023-03-08 Added /s and improved /y in "adc ftpsend". 2023-04-08 New options and syntax of "adc filetest". 2023-04-20 Version released. 1.0.0.55 2023-06-18 Minor changes of "adc blacklist". 2023-11-15 Recompiled using Microsoft Visual Studio Professional 2022. Updated "ADC.exe.config" for modern TLS protocols. 2024-01-06 Version released. 1.0.0.56 2024-01-21 Added option /w to "adc between". 2024-01-27 "adc ftpsend" uses a file cache if /s{size} is 16 KB or less. 2024-02-09 The "ping", "tcpping" and "udpping" commands now make {num} attempts on DNS lookup errors. 2024-02-24 Changed to target .NET Framework v3.5 to run on Windows XP. 2024-03-01 Version released.
Copyright © 1996-2024 Scandinavian Digital Systems AB
Developed by Anders Danielsson