Estou recebendo o erro "No Instance (s) Available" com o seguinte comando wmic.
G:\>wmic datafile where name="file.txt" get creationdate
Você precisa fornecer o nome completo (incluindo a unidade e o caminho) do arquivo.
Exemplo:
F:\test>wmic datafile where name="C:\Windows\system32\notepad.exe" get CreationDate
CreationDate
20090714005636.838522+060
Observe o uso de \
para escapar de um único \
na string de nome de exemplo acima.
If you wish to include the following special characters in your string, you must first escape the character by prefixing the character with a backslash (\):
- backslash (\)
- double quotes (\")
- single quotes (\')
Fonte Cláusula WHERE
Quais são as palavras-chave válidas (nome, caminho, ...) para a cláusula where com o arquivo de dados?
Você pode obter a lista de propriedades a partir da linha de comando usando:
wmic datafile get /?
Qualquer um dos nomes de propriedade pode ser usado em uma cláusula where.
F:\test>wmic datafile get /?
Property get operations.
USAGE:
GET [<property list>] [<get switches>]
NOTE: <property list> ::= <property name> | <property name>, <property list>
The following properties are available:
Property Type Operation
======== ==== =========
Access Rights N/A N/A
Caption N/A N/A
Class Name N/A N/A
Compressed N/A N/A
Compression Method N/A N/A
Computer System Class Name N/A N/A
Computer System Name N/A N/A
Creation Date N/A N/A
Current File Open Count N/A N/A
Description N/A N/A
Drive N/A N/A
Eight Dot Three File Name N/A N/A
Encrypted N/A N/A
Encryption Method N/A N/A
File Extension N/A N/A
File Name N/A N/A
File System Class Name N/A N/A
File System Name N/A N/A
File Type N/A N/A
Hidden N/A N/A
Install Date N/A N/A
Last Accessed N/A N/A
Last Modified N/A N/A
Manufacturer N/A N/A
Name N/A N/A
Path N/A N/A
Readable N/A N/A
Should Be Archived N/A N/A
Size N/A N/A
Status N/A N/A
System File N/A N/A
Version N/A N/A
Writeable N/A N/A