命令在批处理文件中不工作 [英] Command not working in batch file

查看:100
本文介绍了命令在批处理文件中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的Citrix服务器上运行以下命令在CMD窗口中工作正常,但是当我在批处理文件中运行它意外的是这个时候

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?

推荐答案

在批处理文件中,您必须使用%% f而不是%f:

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

这篇关于命令在批处理文件中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆