Anyone familiar with batch scripting?
I need a code which with net view list all the computers name in a domain without the "\\" before it.
The output file should look like this:
PC1
PC2
PC3
Thanks!
bump
cmon, anyone?
last bump
Just in case anyone would need it:
@echo off
if "%1" == "strip" goto :strip
:main
echo.>ntvclean.dat
net view>ntv.dat
for /f "skip=3" %%i in (ntv.dat) do call ntv.bat strip %%i
goto :end
:strip
set cur=%2
if "%cur:~0,2%" NEQ "\\" goto :end
echo %cur:~2%>>ntvclean.dat
:end
>>174275
Holy shit that's dreadful.
Learn to use AWK.
net view | awk "BEGIN {FS="""\\\\"""}; $3 {print $3}"