【问题标题】:batch file doesnt work on Windows 7批处理文件在 Windows 7 上不起作用
【发布时间】:2012-02-07 18:28:17
【问题描述】:

我正在尝试执行一个包含以下内容的简单批处理文件..

ECHO OFF 
::CMD will no longer show us what command it’s executing(cleaner)
ECHO As a network admin, I’m getting tired of having to type these commands in!             
:: Print some text
IPCONFIG /ALL 
:: Outputs tons of network information into the command prompt
PAUSE 
:: Lets the user read the important network information
PING www.google.com 
:: Ping google to figure out if we’ve got internet!
ECHO All done pinging Google. 
::Print some text
PAUSE 

但是,除了命令提示符一闪而过之外,什么也没有发生。 PAUSE 似乎没有任何效果。请帮忙。

【问题讨论】:

  • 您能否确认您的脚本中的IPCONFIG 位实际上不是另一个批处理脚本,它恰好与IPCONFIG 命令同名,并且您的脚本可以通过名称访问它?
  • 顺便说一句,您可以试试sysinternals bginfo - 适用于任何支持台的好工具
  • @AndriyM.. 我交叉检查了...没有其他批处理文件名为 IPCONFIG..
  • 能否让脚本在ipconfig 之前暂停,看看是否是导致问题的原因。
  • 如果你打开一个 CMD 提示符然后运行你的批处理文件会发生什么?

标签: windows-7 batch-file


【解决方案1】:

我认为您需要具有管理员权限才能运行 ipconfig。

【讨论】:

  • 我拥有管理员权限,因为我可以通过命令提示符轻松运行 IP 配置。但是我想使用批处理文件做同样的事情。我猜我的系统上没有批处理文件正常工作。
猜你喜欢
  • 2010-10-03
  • 2019-12-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-28
相关资源
最近更新 更多