Codebox Software

Windows NetView Script


This script establishes a null session with a Windows host, before running the standard net view command to list out the available shares. This technique will sometimes yield information that would normally be denied without authentication.

@echo off
set USAGE="Usage: %0 <hostname>"
if {%1}=={} (
  echo %USAGE% 
  goto EXIT
set HOSTNME=%1
net use \\\%HOSTNME%\ipc$ /u:"" ""
net view \\\%HOSTNME% 
net use \\\%HOSTNME% /DELETE



This is fairly self-explanatory - to run the script just supply the host name that you are interested in as a command-line parameter, for example:

NetView.bat myhost