X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:subject:message-id:references:in-reply-to :from:to:reply-to:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=MRsvkdXNdRupNxaH n+p73Jog9H0W3E7crOowhTzaPvv9+GZKka/7uCW0UURWgaFavim6UtWM+D6jPAyE x1IndXihEkYgxXQCqD7RzZ6jQC56otWozoEaQn8P6gIpcmPDVJuV1YXE+psLO4Fw djyhB0hIS440gtlageyW2qO6ltY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:subject:message-id:references:in-reply-to :from:to:reply-to:mime-version:content-type :content-transfer-encoding; s=default; bh=jJKV9fTmb3ZqRTmwaPJwf+ FdKt8=; b=ep06+q0wIBjnff5RpjPYGgiztN+q37PSNxKTI2P1sI3MMWMZzkZWni aNeLrjzCuPnqonsMdlIaZBz7fGafyaGOLdUykYGxHToM6obXPwPpTysDih0gviKD GV7OtV0dRY/03sJiAfKJ5qBQCo0n6IRcjPLPB5voMzerAeodJ3Jh4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.7 required=5.0 tests=AWL,BAYES_60,RP_MATCHES_RCVD,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail.retting.com X-Footer: cmV0dGluZy5jb20= Date: Mon, 30 Dec 2013 15:16:31 -0800 Subject: getting windows ntfs file info Message-ID: <1756dfaa-4692-4236-bfa0-b9525d03fac1@retting.com> References: <23cd37fc-ba40-4666-81a3-feb46ecfa658 AT retting DOT com> In-Reply-To: <23cd37fc-ba40-4666-81a3-feb46ecfa658@retting.com> From: Jon Retting To: cygwin AT cygwin DOT com Reply-To: Jon Retting MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id rBUNGoDS003933 Hello,     Typed up this one liner function for getting a files actual windows details/properties information.  I needed a tertiary way to compare executable/drivers, so a version number from windows seemed like a viable option. Hopefully someone will find this handy, seeing as i feel so guilty for not contributing more to such a wonderful project like Cygwin. #get file details from windows via wmic wmi formatted call condensed finfo() { [[ -f "$(cygpath "$@")" ]] || { echo "bad-file";return 1;}; echo "$(wmic datafile where name=\""$(echo "$(cygpath -wa "$@")"|sed 's/\\/\\\\/g')"\" get /value)"|sed 's/\r//g;s/^M$//;/^$/d'|awk -F"=" '{print $1"=""\033[1m"$2"\033[0m"}';} ex: $ finfo notepad.exe $ finfo "C:\windows\system32\notepad.exe" $ finfo /cygdrive/c/Windows/System32/notepad.exe $ finfo "/cygdrive/c/Program Files/notepad.exe" $ finfo ../notepad.exe There is no doubt the brilliant people here could have done a better job, but like i said, i just needed to contribute something.  And if you are a gamer you might appreciate this https://github.com/jonretting/geforce-driver-check Cheers, JR -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple