Discussion Locked

Batch File Still

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Was hoping someone could tell me how to do the following :-

FOR /F "tokens=1* delims=: " %%A IN ('SRVINFO -ns %1 ^| FIND "Domain:"') DO SET domain=%%B

The output of the above is domain.ad.co.uk

is there anyway in the batch file to make the variable ignore everything after the . so that any time a domain is found, it is only the first section that is delivered to the variable

E.G doma.ad.co.uk becomes doma
domb just remains domb
dombc.co.uk becomes dombc

Thanks in advance

2 replies

This discussion is closed to new replies.