How do I retrieve the version of a file from a batch file on Windows Vista?

and three ways without external tools 1.WMIC WMIC DATAFILE WHERE name=”C:\\install.exe” get Version /format:Textvaluelist Pay attention to the double slashes of file name. Ready to use script: @echo off :wmicVersion pathToBinary [variableToSaveTo] setlocal set “item=%~1” set “item=%item:\=\\%” for /f “usebackq delims=” %%a in (`”WMIC DATAFILE WHERE name=”%item%” get Version /format:Textvaluelist”`) do ( for /f “delims=” … Read more

How to prevent Vista from requiring elevation on patch.exe?

The problem is that your application does not contain an assembly manifest with a requestedExectutionLevel. Background All correctly written Windows applications are required to have an assembly manifest. And starting in 2006 one of the elements you’re required to have is a requestedExecutionLevel that specifies if your application can only function if the user is … Read more

Disabling UAC programmatically

Set the EnableLUA DWORD value in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System to 0 and reboot. this will disable UAC without a problem, i would do it to all your users, with or without permission is up to you, because the vista UAC is so horrid that i do believe the less people that have it on the better (in … Read more

Why do files get placed in “C:\Users\AppData\Local\VirtualStore\Program Files(x86)”?

An application that is not running with raised privileges should does not have access to the Program Files and Program Files (x86) directories. This is good for safety. In addition, in most cases when a developer tells his program to save data in the Program Files folder, for example, program settings, he has completely forgotten … Read more

Maximum filename length in NTFS (Windows XP and Windows Vista)?

Individual components of a filename (i.e. each subdirectory along the path, and the final filename) are limited to 255 characters, and the total path length is limited to approximately 32,000 characters. However, on Windows, you can’t exceed MAX_PATH value (259 characters for files, 248 for folders). See http://msdn.microsoft.com/en-us/library/aa365247.aspx for full details.