M
Matt Williamson
I'm trying to figure out a way to check for the existance of a command
argument that is equal to a single computer name and if there is no command
argument, process a whole list taken from a net view.
This is what I've tried, but it isn't working and I think it's because the
argument for the FOR loop isn't being read properly. I've tried it with and
without the single quotes, with regular quotes and any other combo I could
think of.
IF "%1"=="" (
set arg='NET VIEW ^| FIND "\\"'
) ELSE (
set arg="\\%1"
)
echo %arg%
pause
FOR /F %%A IN (%arg%) DO (
echo %%A
)
Is there a good way to do this?
TIA
Matt
argument that is equal to a single computer name and if there is no command
argument, process a whole list taken from a net view.
This is what I've tried, but it isn't working and I think it's because the
argument for the FOR loop isn't being read properly. I've tried it with and
without the single quotes, with regular quotes and any other combo I could
think of.
IF "%1"=="" (
set arg='NET VIEW ^| FIND "\\"'
) ELSE (
set arg="\\%1"
)
echo %arg%
pause
FOR /F %%A IN (%arg%) DO (
echo %%A
)
Is there a good way to do this?
TIA
Matt