user2359573
user2359573

Reputation: 1

Command not working in batch file

When I run the command below on my Citrix server in a CMD window it works fine, but when I run it in a batch file I get "was unexpected at this time"

for /f "skip=1 tokens=2 delims=: " %f in ('nslookup www.domain.com ^| find /i "Address"') do ALTADDR /SET %f

How do I get this to work in a batch file?

Upvotes: 0

Views: 1721

Answers (1)

Stephan
Stephan

Reputation: 56228

In a batch file you have to use %%f instead of %f:

for /f "skip=1 tokens=2 delims=: " %%f in ('nslookup www.domain.com ^| find /i "Address"') do ALTADDR /SET %%f

Upvotes: 4

Related Questions