错误消息“系统找不到指定的路径”的原因是什么? [英] What is the reason for the error message "System cannot find the path specified"?

查看:829
本文介绍了错误消息“系统找不到指定的路径”的原因是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的文件夹 system32 中有文件夹 run 。当我从Total Commander中运行 cmd 时,打开一个命令提示符窗口,当前窗口为 C:\Users\admin 目录并想进入该文件夹,将输出以下错误消息:

I have folder run in folder system32. When I run cmd from within Total Commander opening a command prompt window with C:\Users\admin as current directory and want to go into that folder, the following error message is output:


系统找不到指定的路径。

System cannot find the path specified.

当我直接在文件夹 run cmd 时c>,效果很好。为什么?

When I open cmd directly in folder run, it works perfect. Why?

C:\Windows\System32\run 中打开的命令提示符窗口:

The command prompt window on opening in C:\Windows\System32\run:

C:\Windows\System32\run>cd..

C:\Windows\System32>cd run

C:\Windows\System32\run>

仅运行 cmd 的命令提示符窗口:

The command prompt window on simply running cmd:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Všetky práva vyhradené.

C:\Users\admin>cd..

C:\Users>cd..

C:\>cd windows

C:\Windows>cd system32

C:\Windows\System32>cd run
Systém nemôže nájst’ zadanú cestu.


推荐答案

不仅有1个 >在Windows x64上%SystemRoot%\System32 。有 2 个目录。

There is not only 1 %SystemRoot%\System32 on Windows x64. There are 2 such directories.

真实的%SystemRoot%\System32 目录用于64-位应用。该目录包含64位 cmd.exe

The real %SystemRoot%\System32 directory is for 64-bit applications. This directory contains a 64-bit cmd.exe.

,但是还有%SystemRoot%\ SysWOW64 用于32位应用程序。如果32位应用程序访问%SystemRoot%\System32 ,则使用此目录。它包含一个32位 cmd.exe

But there is also %SystemRoot%\SysWOW64 for 32-bit applications. This directory is used if a 32-bit application accesses %SystemRoot%\System32. It contains a 32-bit cmd.exe.

32位应用程序可以访问%SystemRoot%\通过在路径中使用别名%SystemRoot%\Sysnative 在64位应用程序上使用 System32

32-bit applications can access %SystemRoot%\System32 for 64-bit applications by using the alias %SystemRoot%\Sysnative in path.

有关更多详细信息,请参阅Microsoft文档,有关文件系统重定向器

For more details see the Microsoft documentation about File System Redirector.

因此,子目录 run 是在%SystemRoot%\System32 <中创建的/ code>(用于64位应用程序和32位 cmd )正在运行,该目录不存在,因为没有子目录 run %SystemRoot%\SysWOW64 中,这是%SystemRoot%\System32 cmd.exe 子目录 run %SystemRoot%\System32 用于32位应用程序,并且运行64位 cmd ,而该目录不存在。因为在%SystemRoot%\System32 中没有子目录 run ,因为此子目录仅存在于%SystemRoot%\SysWOW64

So the subdirectory run was created either in %SystemRoot%\System32 for 64-bit applications and 32-bit cmd is run for which this directory does not exist because there is no subdirectory run in %SystemRoot%\SysWOW64 which is %SystemRoot%\System32 for 32-bit cmd.exe or the subdirectory run was created in %SystemRoot%\System32 for 32-bit applications and 64-bit cmd is run for which this directory does not exist because there is no subdirectory run in %SystemRoot%\System32 as this subdirectory exists only in %SystemRoot%\SysWOW64.

如果子目录 run <,可以在批处理文件顶部使用以下代码/ code>在%SystemRoot%\System32 中,对于64位应用程序:

The following code could be used at top of the batch file in case of subdirectory run is in %SystemRoot%\System32 for 64-bit applications:

@echo off
set "SystemPath=%SystemRoot%\System32"
if not "%ProgramFiles(x86)%" == "" if exist %SystemRoot%\Sysnative\* set "SystemPath=%SystemRoot%\Sysnative"

必须执行 System32\run 目录中的每个控制台应用程序在批处理文件中使用%SystemPath%,例如%SystemPath%\run\YourApp.exe

Every console application in System32\run directory must be executed with %SystemPath% in the batch file, for example %SystemPath%\run\YourApp.exe.

它如何工作?

在Windows x86上没有环境变量 ProgramFiles(x86),因此实际上只有在顶部定义了一个%SystemRoot%\System32

There is no environment variable ProgramFiles(x86) on Windows x86 and therefore there is really only one %SystemRoot%\System32 as defined at top.

但是定义了环境变量 ProgramFiles(x86) (在Windows x64上具有值)。因此,还要在Windows x64上检查%SystemRoot%\Sysnative 中是否有文件。在这种情况下,批处理文件当前由32位 cmd.exe 处理,并且仅在这种情况下%SystemRoot%\Sysnative 完全需要使用。否则%SystemRoot%\System32 也可以在Windows x64上使用,就像批处理文件由64位 cmd.exe ,这是包含64位控制台应用程序的目录(以及子目录 run )。

But there is defined the environment variable ProgramFiles(x86) with a value on Windows x64. So it is additionally checked on Windows x64 if there are files in %SystemRoot%\Sysnative. In this case the batch file is processed currently by 32-bit cmd.exe and only in this case %SystemRoot%\Sysnative needs to be used at all. Otherwise %SystemRoot%\System32 can be used also on Windows x64 as when the batch file is processed by 64-bit cmd.exe, this is the directory containing the 64-bit console applications (and the subdirectory run).

注意:%SystemRoot%\Sysnative 不是目录! cd %SystemRoot%\Sysnative 或使用(如果存在)是不可能的SystemRoot%\Sysnative (如果存在)%SystemRoot%\Sysnative\ 。它是仅用于32位可执行文件的特殊别名,因此有必要使用检查是否存在使用此路径的一个或多个文件(如果存在)%SystemRoot%\Sysnative\cmd.exe 或更通用的,如果存在%SystemRoot%\Sysnative\ *

Note: %SystemRoot%\Sysnative is not a directory! It is not possible to cd to %SystemRoot%\Sysnative or use if exist %SystemRoot%\Sysnative or if exist %SystemRoot%\Sysnative\. It is a special alias existing only for 32-bit executables and therefore it is necessary to check if one or more files exist on using this path by using if exist %SystemRoot%\Sysnative\cmd.exe or more general if exist %SystemRoot%\Sysnative\*.

这篇关于错误消息“系统找不到指定的路径”的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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