32
5
I'm working with InstallAnywhere, an old program for creating installers. I would like to install a particular file, only in case of Windows XP and Windows Vista.
Due to InstallAnywhere limitations, this is not possible. I can only decide to delete the file once it has already been installed, based on a rule.
Within that rule, I can check for the platform on which I'm running, which gives me the possibility to check for Windows XP, Windows Vista, Windows 7, etc. but not for Windows 10. I can't say "Perform this action when the system is not XP or Vista", so I need to say "Perform this action on all those platforms, which are not XP or Vista".
However, I can launch command-line commands and catch the result, so here's my question: is there a command which I can use for determining if I'm working on a Windows 10 system?
winver
will pop up the About Windows dialog if typed in cmd or Start. Would that work? Alternatively - http://stackoverflow.com/questions/1792740/how-to-tell-what-version-of-windows-and-or-cmd-exe-a-batch-file-is-running-on – Tetsujin – 2016-05-12T09:17:54.480Thanks for the reply, but I'm looking for a command-line command which gives an answer in the command-line, I can't use the information in a batch-type way when a messagebox pops up. – Dominique – 2016-05-12T11:14:32.727
Check for cmd.exe version, it's the easiest and supported at least since XP. There is a question about it. – KeyWeeUsr – 2016-05-12T11:55:40.883
I've just tried it on my Windows 7 system:
cmd --version
give as a resultMicrosoft Windows [Version 6.1.7601]
, so the relation betweencmd
version and Windows version seems not that straightforward, what can I expect on Windows 10? – Dominique – 2016-05-12T12:03:19.2732
google cmd versions, each os has different version number, you can check for that and you don't need any unnecessary long script or another program - here
– KeyWeeUsr – 2016-05-12T13:38:27.800You're right, KeyWeeUsr, on the URL "http://www.windows-commandline.com/find-windows-os-version-from-command/" I've found some interesting information.
– Dominique – 2016-05-12T14:22:47.6335
Just type
– Andreas Rejbrand – 2016-05-12T16:30:27.327ver
. For example, on my Windows 7 system I get "Microsoft Windows [Version 6.1.7601]" which tells me that I am running Windows 7 (which has version number 6.1).