How to get version number for any installed program using cmd? - cmd

I want to get Version number for particular installed program on windows. I do not want complete list of program, just version number for particular program just like we get java version e.g. java -version
I tried to get version number for Google chrome installed on my system:
Command : google chrome -version
I am expecting just like below command gives exact version of java , I should get version number of any installed program on my system
java -version
shows exact version

In Windows
The first of all, you need to get the path of the .exe file of the application.
You can use wmic to get the information of the application.
And we set the name key for which application you want to check.
> wmic datafile where 'name="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"'
AccessMask Archive Caption Compressed CompressionMethod CreationClassName CreationDate CSCreationClassName CSName Description Drive EightDotThreeFileName Encrypted EncryptionMethod Extension FileName FileSize FileType FSCreationClassName FSName Hidden InstallDate InUseCount LastAccessed LastModified Manufacturer Name Path Readable Status System Version Writeable
1179817 TRUE C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe FALSE CIM_LogicalFile 20200924185451.733609+480 Win32_ComputerSystem DESKTOP-QCUDFJL C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe c: c:\program files (x86)\microsoft\edge\application\msedge.exe FALSE exe msedge 2882448 Application Win32_FileSystem NTFS FALSE 20200924185451.733609+480 20200928200140.091076+480 20200923164851.469016+480 Microsoft Corporation C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe \program files (x86)\microsoft\edge\application\ TRUE OK FALSE 85.0.564.63 TRUE
In addition, you can filter the result by adding get {key} at the end of command.
> wmic datafile where 'name="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"' get version
Version
85.0.564.63

wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
OUTPUT:
Version=73.0.3683.103

Related

Oracle Universal Installer stops after launch (Oracle Forms and Reports 12.2.1.4)

i try to install Oracle Forms and Reports 12.2.1.4, but everytime I run setup.fmw.12.2.1.4.0_fr_win64.exe file Oracle Universal Installer window shows up for a moment with communicate "Preparing the installer...". After that it dissappears and shows again with another communicate: "Cleaning up...". After this communicate, the installer window turns off and there are no other steps.
Screens below
first communicate
second communicate
Did anybody have this problem also? My JAVA_HOME is set as C:\Java\jdk1.8.0_241 and PATH=%JAVA_HOME%\bin.
Here's also -debug log below
m_szTempDirectory: C:\Windows\Temp
Extract to C:\Windows\Temp\sfxCD9A.tmp
Extracting sfx.ini from D:\setup_fmw_12.2.1.4.0_fr_win64.exe to C:\Windows\Temp\sfxCD9A.tmp
Wiz_SingleEntryUnzip (extractAutorun) return code: 0
Total uncompressed size: 2447428290
m_szTempDirectory: C:\Windows\Temp
Extract to same C:\Windows\Temp\sfxCD9A.tmp
Extracting installer files
Wiz_SingleEntryUnzip() result: 0
Total disks: 1 (1)
Finished extracting Disk1
Using version 1.8.0.211.12 of component Disk1\stage\Components\oracle.jre
Jar list: Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
New command: oracle.jre\.\jdk\jre\bin\java.exe -jar install/modules/ora-launcher.jar
Unzipping Java jars Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar to oracle.jre
Getting size of Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
Size of Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar: 201205655
Checking space for Java components in C:\Windows\Temp
Unzipping Java jars: Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
Unzipping Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
Launch command length: 278
Launch command: "C:\Windows\Temp\sfxCD9A.tmp\oracle.jre\jdk\jre\bin\java.exe" "-Djava.io.tmpdir=C:\Windows\Temp" "-Dsfx.installer.launcher.home=D:\" "-Dsfx.extract.path=C:\Windows\Temp\sfxCD9A.tmp" "-Dsfx.exe=D:\setup_fmw_12.2.1.4.0_fr_win64.exe" -jar install/modules/ora-launcher.jar "-debug"
cmdLine: "C:\Windows\Temp\sfxCD9A.tmp\oracle.jre\jdk\jre\bin\java.exe" "-Djava.io.tmpdir=C:\Windows\Temp" "-Dsfx.installer.launcher.home=D:\" "-Dsfx.extract.path=C:\Windows\Temp\sfxCD9A.tmp" "-Dsfx.exe=D:\setup_fmw_12.2.1.4.0_fr_win64.exe" -jar install/modules/ora-launcher.jar "-debug"
Command successfully started; waiting for completion
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
dwExitCode: 1
myspawn() result: 1
Press any key to exit
To be clear, you need to start the installer using an elevated shell. This is not the same as being a member of the Windows "Administrator" group. Right-click on the exe and click on "Run as administrator".
Instead of running setup.exe, try execute \install\oui.exe -debug

why in the systemout.log of websphere i see wrong operating system information?

This is the start of my SystemOut.log of my WAS. Why i see a wrong operating system? i have windows server 2012 and not win srv 2008. Do you know where websphere take this information?
************ Start Display Current Environment ************
-WebSphere Platform 8.5.5.0 [ND 8.5.5.0 gm1319.01] running with process name blabla\blabla\server1 and process id 1234
-Host Operating System is Windows Server 2008, version 6.2 build 9200
-Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM
-was.install.root = C:\Program Files\IBM\WASND85
-user.install.root = C:\Program Files\IBM\WASND85\profiles\AppSrv01
-Java Home = C:\Program Files\IBM\WASND85\java\jre
-ws.ext.dirs = C:\Program Files\IBM\WASND85/java/lib;C:\Program Files\IBM\WAS
-Classpath = C:\Program Files\IBM\WASND85\profiles\AppSrv01/properties;C:\Pro
-Java Library path = C:\Program Files\IBM\WASND85/lib/native/win/x86_64/;C:\P
-Orb Version = IBM Java ORB build orb626-20130112.01
************* End Display Current Environment *************
Thankyou in advance!!!!!!
bye
Based on my knowledge, WAS is taking the information from system property "os.name" and "os.version".
A quick way of checking is to write a quick java test class and have it print out the result of System.getProperty("os.name").toLowerCase() and System.getProperty("version").toLowerCase(). Then verify if they match the string you got from WAS log files' header.
The JVM pulls this information from a Windows API call (GetVersionEx). There was a change to this Windows API that required a change to the JDK in order to show the correct Windows OS name:
https://bugs.openjdk.java.net/browse/JDK-8059803
Since you are running a very old version of Java, upgrading to a later version should help.

Verpatch.exe error

I am trying to add new version resource string to .exe file using verpatch.
I need to add new sting to version resource as I am creating test connector to Qlikview. For QlikView and Qlik Sense to be able to recognize an .exe file as a connector, the file version information resource must include the property “QlikView Connector”.
I am developing my connector with Visual Studio and this command is run as a post build command and build ends with error. I also tried to run it from command line with same result:
C:\verpatch>verpatch.exe C:\QV_temp\QVTestConnector.exe /s "QlikView Connector" "Qv Test Connector"
Exception in ParseBinaryVersionResource
Error in ParseBinaryVersionResource
error parsing version info from the file
Some of actions failed, exiting
I have also tried different versions on verpatch.exe. Any ideas?
The example that Qlik gives on their documentation does not seem to work with the version of verpatch.exe that ships with QVX SDK 2.1.
I resolved this error by updating to a newer version from CodePlex.
Edit:
verpatch seems to have moved to https://github.com/pavel-a/ddverpatch/releases
Please see documentation. After /s should go "description".
If it has problem reading existing version resource, try to rewrite it completely with /va. So, do something like:
verpatch your.exe 1.0.0.0 /va /s desc "QlikView Connector" /s product "Qv Test Connector"
If you can share the problematic exe with the author of verpatch (on Codeplex), he may provide a fix.
I couldn't set properties on my executable with any version of verpatch - because I had a different codepage in the resource strings.
I would recommend rather using the Python package pe-tools (PyPI), which has a nicely documented command peresed that does this (docs).
You can also set specific version-info fields or set resource entries to the contents of a file:
peresed filename.exe -V "QlikView Connector=Qv Test Connector"
I have run this command successfully, but not verified whether the properties were set - but other properties like FileDescription are set correctly.

Python cant see files or folders in C:\Windows\System32\GroupPolicy

I'm running into a problem where python is unable to see folders or files which do exist on the computer. I have already ensured the path has no symbolic links in it and that I have full control on the NTFS file permissions. I have even removed any hidden attributes. Below is the script I am using and its output:
import os
path = 'C:\\Windows\\System32\\GroupPolicy\\Machine'
print path
test = os.path.exists(path)
print test
C:\Windows\System32\GroupPolicy\Machine
False
I am unsure why it is returning False when I have ensured the folder does exist. If I remove "\Machine" from the path, it returns True. I have verified the following command works from a command prompt:
if exist c:\Windows\System32\GroupPolicy\Machine echo found
Any advice on how to get this working in python would be appreciated. Here is the version of python I am using:
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Alright, after some digging, found it is nothing to do with permissions but has to do with File System Redirection. As I am using the x86 version of python on a Windows x64 (using x86 as I am using py2exe), Windows is redirecting any queries on System32 and subdirectories to SysWOW64. This means I was actually querying "C:\Windows\SysWOW64\GroupPolicy\Machine" which did not exist.
To fix this, I found how to disable the File System redirection using the recipe found here: http://code.activestate.com/recipes/578035-disable-file-system-redirector/
Here is my final code which now works to disable the redirection and allows opening and querying of files in System32 on a 64 bit machine.
import ctypes
class disable_file_system_redirection:
_disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
_revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
def __enter__(self):
self.old_value = ctypes.c_long()
self.success = self._disable(ctypes.byref(self.old_value))
def __exit__(self, type, value, traceback):
if self.success:
self._revert(self.old_value)
disable_file_system_redirection().__enter__()
import os
path = 'C:\\Windows\\System32\\GroupPolicy\\Machine'
print path
test = os.path.exists(path)
print test

Typesafe activator: Java JDK can't be found

I am trying to run the typesafe activator on Windows 8.1 x64. It keeps saying I don't have a valid JDK installation:
A Java JDK is not installed or can't be found.
JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_45\bin"
Please go to
http://www.oracle.com/technetwork/java/javase/downloads/index.html
and download a valid Java JDK and install before running Activator.
If you think this message is in error, please check
your environment variables to see if "java.exe" and "javac.exe" are
available via JAVA_HOME or PATH.
Press any key to continue . . .
I have my JAVA_HOME set to:
C:\Program Files\Java\jdk1.7.0_45\bin
Which is a valid location.
JAVA_HOME should just point to the JDK directory, not bin.
Here was my workaround:
Add the following code to your activator.bat on line 112:
if "%JAVAOK%"=="false" (
set "_JAVACMD=C:\Program Files (x86)\Java\jdk1.6.0_91\bin\java.exe"
set "JAVAOK=true"
set "JAVA_VERSION=1.6"
)
Or where ever your java.exe is located at, and whatever your Java Version is.
Your code should now look like:
rem BAT has no logical or, so we do it OLD SCHOOL! Oppan Redmond Style
set JAVAOK=true
if not defined JAVAINSTALLED set JAVAOK=false
if not defined JAVACINSTALLED set JAVAOK=false
if "%JAVAOK%"=="false" (
set "_JAVACMD=C:\Program Files (x86)\Java\jdk1.6.0_91\bin\java.exe"
set "JAVAOK=true"
set "JAVA_VERSION=1.6"
)
if "%JAVAOK%"=="false" (
echo.
When I typed "path" in cmd, I got my classpath, but "java_home", "java -v", etc didn't work. I don't know why I am having that issue, but my (ugly) workaround worked.
I had a similar problem on Windows 7 64b. The problem solved by changing the installed directory from 'C:\Program Program..' to a directory without space like 'c:\java'.
So the solution is: Installing Java to a path without spaces.
I hope it can help.
This worked for me:
Open a Command Prompt as administrator
Navigate to the folder with activator.bat
Type 'activator ui' without the '
Press enter

Resources