Archive: Question about a DOS command (yes DOS)


Question about a DOS command (yes DOS)
I had to do a quick and dirty installaion to repair a customer's fubar. I needed to check the windows version. I usually do not have to do this so I have not looked at the proper script.

Using the VER command, I wanted to put the os version into a text file. I tried to do this:


ExecShell open "c:\ver.exe" "> test.txt"

and then

ExecShell open "c:\ver.exe > test.txt"
(also tried "Exec")

Neither worked (but NSIS did not gibe any errors) so I finally just copped out and used
ExecShell open "C:\testing\a.bat"
which did the trick.

Not a big deal, but I was wondering why the first and the second bits of code did not work or cause an error at compile.


If you want to get Windows version, check the forum & the wiki for some functions :)


Re: Question about a DOS command (yes DOS)

Originally posted by Oscar Prophet
Not a big deal, but I was wondering why the first and the second bits of code did not work or cause an error at compile.
The reason is that there is no ver.exe program. The "ver" command is implemented internally by the cmd.exe command interpreter. You probably would have had better luck using the command:

"cmd.exe /c ver > test.txt"

Though I'm not 100% sure that the redirection would work.

Batch file is better way for compatibility with old Wins http://forums.winamp.com/showthread....84#post1803084
To hide DOS window and to redirect output to log file you can use ExecDos plug-in.
Another way (not require output string parsing) - version plug-in http://nsis.sourceforge.net/Detect_Windows_Version


Or as already suggested use an NSIS function:
http://nsis.sourceforge.net/Docs/AppendixC.html#C.5

-Stu