Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: find command no longer works on my win 7 machine


21 Sep 2012   #1

win 7 professional, 32bit on 64 bit hardware
 
 
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


My System SpecsSystem Spec
.

21 Sep 2012   #2

XP / Win7 x64 Pro
 
 

findstr is not failing because it uses regular expressions to find strings (unless you specify otherwise) so it's not literally interpreting the string you're inputting. In order for it to interpret the string literally, you'd want to use the following:

findstr /C:"Version 6.1"
My System SpecsSystem Spec
Reply

 find command no longer works on my win 7 machine




Thread Tools



Similar help and support threads for2: find command no longer works on my win 7 machine
Thread Forum
GDI++ no longer works in IE9! Customization
Flash no longer works Browsers & Mail
Xp Internet no longer works under win 7 Network & Sharing
Backup no longer works Backup and Restore
Mute no longer Works Sound & Audio
Third Mouse Button No Longer Works. Hardware & Devices
Flash no longer works in any browser Browsers & Mail

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 03:43 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33