无法在Windows 10下运行.bat文件 [英] Can´t run .bat file under windows 10
问题描述
我在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.
- 右键单击
.bat
文件之一,然后选择编辑".这将在记事本中打开文件. - 转到文件的最后,然后按"enter"键添加新行.
- 键入
pause
. - 保存文件.
- 使用以前相同的方法再次运行文件.
- Right click on one of the
.bat
files and select "edit". This will open the file in notepad. - Go to the very end of the file and add a new line by pressing "enter".
- type
pause
. - Save the file.
- 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.
- 在
.bat
文件所在的文件夹中,按住"Shift"键并右键单击空白. - 选择在此处打开命令窗口".
- 您现在将看到一个新的命令提示符.输入批处理文件的名称,然后按Enter.
- In the folder where the
.bat
files are located, hold down the "shift" key and right click in the white space. - Select "Open Command Window Here".
- 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屋!