无法在Windows 10下运行.bat文件 [英] Can´t run .bat file under windows 10

查看:1076
本文介绍了无法在Windows 10下运行.bat文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows XP下使用的.bat文件很少.现在,我想在Windows 10下使用它们,但是当我运行一个文件(甚至以管理员身份)时,它会显示命令提示符屏幕1秒钟,并且什么也没有发生.

I have few .bat files that I used under Windows XP. Now I want to use them under Windows 10, but when I run one of the files (even as administrator) it shows the command prompt screen for 1 second and nothing happens.

有人可以帮我吗?

推荐答案

没有固有的原因可以在XP中运行简单的批处理文件,而不能在Windows 10中运行.不复存在.要了解实际情况,您需要执行以下操作之一:

There is no inherent reason that a simple batch file would run in XP but not Windows 10. It is possible you are referencing a command or a 3rd party utility that no longer exists. To know more about what is actually happening, you will need to do one of the following:

  • pause添加到批处理文件中,以便您可以在退出之前查看正在发生的情况.
  • Add a pause to the batch file so that you can see what is happening before it exits.
  1. 右键单击.bat文件之一,然后选择编辑".这将在记事本中打开文件.
  2. 转到文件的最后,然后按"enter"键添加新行.
  3. 键入pause.
  4. 保存文件.
  5. 使用以前相同的方法再次运行文件.
  1. Right click on one of the .bat files and select "edit". This will open the file in notepad.
  2. Go to the very end of the file and add a new line by pressing "enter".
  3. type pause.
  4. Save the file.
  5. Run the file again using the same method you did before.

-或-

  • 从静态命令提示符处运行批处理文件,以使窗口不会关闭.
  • Run the batch file from a static command prompt so the window does not close.
  1. .bat文件所在的文件夹中,按住"Shift"键并右键单击空白.
  2. 选择在此处打开命令窗口".
  3. 您现在将看到一个新的命令提示符.输入批处理文件的名称,然后按Enter.
  1. In the folder where the .bat files are located, hold down the "shift" key and right click in the white space.
  2. Select "Open Command Window Here".
  3. You will now see a new command prompt. Type in the name of the batch file and press enter.

完成此操作后,建议您使用上面的一种方法后,使用您看到的输出创建一个新问题.

Once you have done this, I recommend creating a new question with the output you see after using one of the methods above.

这篇关于无法在Windows 10下运行.bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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