General discussion

Locked

Batch File Still

By mbyrne3375 ·
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

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to IT Employment Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums