Command line
The Network Scanner supports a number of command-line switches for automation. Use them as netscan.exe /switch1 /switch2 … /switchN
Scanning and exporting
- /auto:filename.[txt|htm|xml|csv|json|db]
- Runs a scan with global settings and exports the results to a file. The file format is determined by the extension. The .db extension produces a SQLite database with a DEVICE table (one column per visible scan column) and a SHARE table (name, attributes and a foreign key to the device). Examples:
netscan.exe /hide /auto:"c:\desktop\result.txt"netscan.exe /hide /auto:"c:\desktop\result.htm"netscan.exe /hide /auto:"c:\desktop\result.csv"
To run a scan without exporting, specify /auto without a parameter. You can include date/time tokens in the file name using any combination of the following, each enclosed between two percent signs: y, yy, yyyy, m, mm, mmm, mmmm, d, dd, ddd, dddd, h, hh, n, nn, s, ss. For example:
netscan.exe /hide /auto:"scan_%yyyy%%mm%%dd%_time_%hh%%nn%.csv" - /live:filename.[txt|htm|xml|csv|db]
- Similar to /auto, but leaves the application running with background scanning enabled. The specified file is updated after every complete round, so it always reflects the latest state.
- /hide
- Hides the main window (silent mode). If launched from a command prompt, progress is displayed in the console. For better readability, use:
start /wait netscan.exe /hide /auto:"result.csv"
- /config:filename.xml
- Loads the specified XML configuration file into the application.
- /mpass:secretpassword
- Specifies the decryption password for an encrypted configuration file, avoiding interactive prompts.
- /load:filename.xml
- Loads the specified XML result set into the application. Can be combined with /auto to rescan and re-export.
- /range:from-to
- Sets an IP address range for scanning. Multiple ranges should be comma-separated. To pass a non-contiguous range, append #N. Examples:
netscan.exe /range:192.168.0.1-192.168.10.254netscan.exe /range:10.64.1.1-10.64.5.10#N
- /range:type
- Automatically detects IP address ranges. Valid types are all, v4 and v6. For example, /range:v4 detects all available IPv4 ranges.
- /file:filename.txt
- Loads IP addresses from a text file and uses them as scan targets. Use with /auto or /live. The file format is the same as described in scan ranges.
- /cols:col1;col2;col3
- Exports only the specified columns. Otherwise all visible columns are exported. Example:
netscan.exe /hide /auto:result.csv /cols:"Host Name;MAC Address"
- /append
- Applies to /auto for text and CSV files. Appends results to the file instead of overwriting it.
- /merge
- Applies to /auto for text and CSV files. Merges results with those already in the file; lines are sorted and duplicates removed.
- /splitmv
- Applies to /auto for text and CSV files. Splits cells with multiple comma-separated values into separate rows.
- /sharetype:type
- Filters the exported shares by type. Specify one or more letters to include only matching shares: C (common), R (restricted), W (writable), A (administrative) and P (printer). Letters can be combined, e.g. /sharetype:CW includes common and writable shares only.
Wake-On-LAN
- /wol:mac
- Sends a Wake-On-LAN magic packet to the specified MAC address and immediately exits. Example:
netscan.exe /wol:AABBCCDDEEFF
- /wolfile:filename.txt
- Sends WOL packets to all MAC addresses listed in the specified text file (one per line) and exits.
- /wakeall
- Sends a WOL packet to all devices configured in the WOL manager and exits.
Batch file creation
The Network Scanner can generate batch scripts for running commands against multiple devices. Select one or more devices in the results, then choose Actions → Create Batch File.
In the command template, use %0 for the IP address, %1 for the share name, or [column] to refer to any column. Built-in examples are provided:
- Disable a service
- Copy files to a remote device
- Add a value to the registry
Click Preview to see the generated batch file, Save to write it to disk, or Copy to copy it to the clipboard.
Create a Windows scheduled task that runs the following command each morning:
This automatically detects all IPv4 ranges, scans them with your saved settings, and exports the results to a dated CSV file. Over time, you build a daily record of every device on your network.
Prepare a text file with the MAC addresses of all target machines. Then run:
Follow this with a short delay and then your deployment tool. The machines will be awake and ready to receive the update.