如何在windows中正确执行批处理脚本?

如何在windows中正确执行批处理脚本?

根据这个答案如何删除嵌套较深的文件夹并避免“文件名太长”?,我1.bat使用以下来源创建了文件:

@echo off
if not (%1)==() cd %1
for /D %%i in (*) do if not %%i==_ ren "%%i" _
pushd _ 
%0 
popd

我把这个文件放在我想删除的文件夹附近。

在此处输入图片描述

我点击1.bat

并参见以下内容:

.....
Access is denied.
The system cannot find the path specified.
Access is denied.
The system cannot find the path specified.
Access is denied.
The system cannot find the path specified.
Access is denied.
The system cannot find the path specified.
Access is denied.
The system cannot find the path specified.
Access is denied.
....

我做错什么了?

相关内容