New
#1
find command no longer works on my win 7 machine
We have a script that installs an application on a user's box. It can run on XP, Vista, Win 7.... So it uses the ver command and find to figure out what the os is. It used to run on my win 7 box. It no longer does. The find command now gets an error. I tried substituting findstr and it returns a good completion code regardless! The grep command works great but most machines don't have grep so that is not an option to use. I would just like to figure out why find doesn't work. The date for find.exe in the System32 folder says 7/13/2009. Is there something I can do to restore find? Listed below is the the command & output that helps determine the OS version using find/findstr/grep
C:\Users\pwilliams>ver
Microsoft Windows [Version 6.1.7601]
C:\Users\pwilliams>ver|find "Version" <-- this used to work!!
find: `Version': No such file or directory
C:\Users\pwilliams>echo %ERRORLEVEL%
1
C:\Users\pwilliams>ver|findstr "Version"
Microsoft Windows [Version 6.1.7601]
C:\Users\pwilliams>echo %ERRORLEVEL%
0
C:\Users\pwilliams>ver|findstr "Version 6.0" <-----
Microsoft Windows [Version 6.1.7601] |
C:\Users\pwilliams>echo ERRORLEVEL% |--one should fail!
0 |
C:\Users\pwilliams>ver|findstr "Version 6.1" <-----
Microsoft Windows [Version 6.1.7601]
C:\Users\pwilliams>echo %ERRORLEVEL%
0
C:\Users\pwilliams>ver| grep "Version 6.1"
Microsoft Windows [Version 6.1.7601]
C:\Users\pwilliams>echo %ERRORLEVEL%
0
C:\Users\pwilliams>ver |grep "Version 6.0"
C:\Users\pwilliams>echo %ERRORLEVEL%
1