C: \ Progra ~ 2 does not work in OEM version of Windows 8

I am working on creating a batch file in Windows 8 that will not accept "C:\Program files" in its body, because the space between Program and files gives an error. So, I used "C:\Progra~2" .

I want to access Program files (x86) .

I have two PCs with Windows 8: Windows 8 PRO and Windows 8 OEM.

When I "C:\Progra~2" from Explorer to access program files (x86) it successfully opens in Windows 8 PRO.

But when I do the same in Windows 8 OEM, it says

Windows cannot find C: \ Progra ~ 2.

I'm not sure if this is a problem with the PRO and OEM versions.

Can someone help me find a solution?

+4
source share
2 answers

Use the package built in Constant:% ProgramFiles%. He also works on a non-English version of Windows that your ~ 2 does not have.

+5
source

Are you sure that there are two program files on both machines? Try C:\Progra~1 and see if it opens the correct folder.

If you want to open the shared program files folder, use %ProgramFiles%

0
source

Source: https://habr.com/ru/post/1483143/


All Articles