Created
March 21, 2014 23:49
-
-
Save AdilHindistan/9698886 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Query cim_datafile class to find an executable | |
# http://msdn.microsoft.com/en-us/library/aa387236(v=vs.85).aspx | |
get-wmiObject -query "select FileName,Extension,FileSize,Path,CreationDate,InstallDate,LastAccessed from cim_datafile where Drive='d:' AND FileName='powershell' and extension='exe'" | |
CreationDate : 20130822065947.699027-240 | |
Extension : exe | |
FileName : powershell | |
FileSize : 479744 | |
InstallDate : 20130822065947.699027-240 | |
LastAccessed : 20130822065947.699027-240 | |
Path : \windows\system32\windowspowershell\v1.0\ | |
PSComputerName : | |
CreationDate : 20130821233619.548432-240 | |
Extension : exe | |
FileName : powershell | |
FileSize : 461312 | |
InstallDate : 20130821233619.548432-240 | |
LastAccessed : 20130821233619.548432-240 | |
Path : \windows\syswow64\windowspowershell\v1.0\ | |
PSComputerName : | |
## if no properties are specified | |
H:\> gwmi cim_datafile -filter "Drive='d:' AND FileName='powershell' and extension='exe'" | |
Compressed : False | |
Encrypted : False | |
Size : | |
Hidden : False | |
Name : d:\windows\system32\windowspowershell\v1.0\powershell.exe | |
Readable : True | |
System : False | |
Version : 6.3.9600.16384 | |
Writeable : True | |
Compressed : False | |
Encrypted : False | |
Size : | |
Hidden : False | |
Name : d:\windows\syswow64\windowspowershell\v1.0\powershell.exe | |
Readable : True | |
System : False | |
Version : 6.3.9600.16384 | |
Writeable : True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment