B
Barney
I'm trying to write a script that will report the number
of characters in a share's comment. The comments in
question refer to shared printers on our Windows 2000
Server.
I have the following:
---------- Begin Code Snippet -------------------
FOR /F "Skip=8 Tokens=3*" %%A IN ('NET VIEW
\\PrinerServer') DO (
SET PrinterName=%%A %%B
CALL :CharacterCounter
)
PAUSE
:CharacterCounter
SET Count=0
:Loop
CALL SET Check=!PrinterName:~%Count%,1!
IF DEFINED Check SET /A Count=Count+1 & GOTO :Loop
ECHO/!PrinterName! is %Count% characters long.
GOTO :EOF
---------- End Code Snippet -------------------
This, however, does not work. It reports the share
comment correctly but not the number of character in
the 'field'.
Any suggestions?
of characters in a share's comment. The comments in
question refer to shared printers on our Windows 2000
Server.
I have the following:
---------- Begin Code Snippet -------------------
FOR /F "Skip=8 Tokens=3*" %%A IN ('NET VIEW
\\PrinerServer') DO (
SET PrinterName=%%A %%B
CALL :CharacterCounter
)
PAUSE
:CharacterCounter
SET Count=0
:Loop
CALL SET Check=!PrinterName:~%Count%,1!
IF DEFINED Check SET /A Count=Count+1 & GOTO :Loop
ECHO/!PrinterName! is %Count% characters long.
GOTO :EOF
---------- End Code Snippet -------------------
This, however, does not work. It reports the share
comment correctly but not the number of character in
the 'field'.
Any suggestions?