Visual Studio pre-build scripts cannot find exe files in windows / system32

I'm at a dead end. Suddenly, Visual Studio cannot find exe files in the Windows / System32 directory (e.g. xcopy, attrib, etc.).

I have some pre-build and post-build events that execute batch files that use xcopy and attribute. Previously, they worked fine, but today, during the build process, Visual Studio cannot find them. An error is displayed: "xcopy" is not recognized as an internal or external command, operating program, or batch file.

When I first noticed the problem, I tried running xcopy on a regular cmd command line and the same problem occurred. After restarting the computer, the problem disappeared on the normal command line, but remained in Visual Studio. After a reboot, the problem does not occur on the Visual Studio command line β€” or only from Visual Studio itself.

Everything looks fine if one of the batch files I execute is set to check the PATH variable or echo% systemroot%.

In the menu "Tools-> Options" there are settings for VisualC ++ directories. However, I am running C #, not C ++, and furthermore, I have never changed these settings, and they seem to be correct.

Has anyone had this problem before? Thoughts?

+5
2

Visual Studio.

XCOPY "xcopy" , "

, C:\WINDOWS\SYSTEM32 XCOPY. !

:

  • β†’ β†’ β†’

  • Windows , : % SystemRoot%\system32;% SystemRoot%;% SystemRoot%\system32\Wbem

    PATH "".

, , .

+4

: PATH, , (, XCOPY).

% systemroot% , XCOPY .. SYSTEM ( WinXP C:\Windows\System32), % systemroot% - Windows ( - , XP C:\Windows).

+1

All Articles