Как определить версию архитектуры Windows на отключенном томе?

917
ylluminate

У меня есть сценарий, в котором мне нужно скопировать некоторые файлы Windows 10, чтобы исправить какую-то форму повреждения, которую SFC (System File Checker) не пытается полностью устранить.

Как определить тип архитектуры (32 или 64-разрядный) отключенного тома Windows через командную строку или оболочку Unix? Я предполагаю, что есть некоторые записи, которые можно извлечь из кустов реестра или что-то в этом роде, чтобы изолировать тип арки.

6
Ищите «Program Files (x86)», если он не существует, то он 32-битный. Ƭᴇcʜιᴇ007 8 лет назад 4
: D Ха, спасибо за этот очевидный ответ. Я полагаю, что, когда вы находитесь в процессе мучения от головной боли, вы иногда забываете самое очевидное. ylluminate 8 лет назад 0
Нет проблем. Кажется, я не могу найти дубликат (кажется, что об этом уже спрашивали), поэтому я добавлю его в качестве ответа. :) Ƭᴇcʜιᴇ007 8 лет назад 1
В случае сильно поврежденной файловой системы (без программных файлов;)) вы можете попробовать проверить [exe-битность] (http://superuser.com/questions/358434/how-to-check-if-a-binary-is-32 -или-64-бит на окнах) (например, cmd.exe) PTwr 8 лет назад 1

2 ответа на вопрос

17
Ƭᴇcʜιᴇ007

Look for "Program Files (x86)", if it doesn't exist, then it's 32-bit.

Related:

в этом случае ответ кажется самым глупым, самый умный, кстати, upvote;) Francisco Tapia 8 лет назад 2
С этой же точки зрения существует C: \ Windows \ SysWOW64, который должен существовать только в 64-разрядной установке. Kamen Minkov 8 лет назад 1
3
Wes Sayeed

There is no way to determine from the connection to the share itself what the platform of the server hosting the share is. The SMB protocol abstracts all of that information intentionally (this is why you can copy files to/from an NTFS share under Linux or a Mac where NTFS isn't supported).

You can glean this information anecdotally if the entire OS volume is shared (or by connecting to the C$ share -- which isn't available on non-Windows Samba servers). However, the best way to determine if the host is 64 or 32-bit is to look at the %PROCESSOR_ARCHITECTURE% environment variable on the host. The reason is because some badly-written software creates a Program Files (x86) folder or writes to a Wow6432 node in the registry even on 32-bit platforms, so their presence does not necessarily mean the platform is 64-bit.

However, all this depends on the host being available and you having the access to query it. There is no way, from a share alone on a server you don't otherwise have access to, to determine the platform of the OS hosting it if the files don't give you a hint.