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
th3louvre

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
FliGi7

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
Thread Forum
USB 3.0 no longer works
I bought an HP Pavilion 2 years ago. AMD A-10 proc with 8gig mem. Worked fine for 6 months. HDMI quit working. Started using VGA. Bought Seagate USB 3.0 2 TByte for backup. Worked fine. 18 months later MSI MS-7778 motherboard started giving me trouble on start up. I'd push the power button...
Hardware & Devices
Sound no longer works
After the last update from MS, my sound no longer works. I rolled back to the last restore point, and then to the one just prior to that. Still doesn't work. I've changed no drivers in a long, long time. Suggestions?
Sound & Audio
Flash no longer works
It seems my Flash no longer works. When I go to a site that uses Flash, there is a blank screen where the Flash player is located. I am using IE8 (32 bit). When I go to download Flash from the Adobe site, I get an error that there was a GUI error. Any ideas what is happening? BTW, I assumed...
Browsers & Mail
Xp Internet no longer works under win 7
Ok I just made the switch from xp to win 7 ultimate (64) and everything is working great exept the Internet, inside my computer I have a dlink DGE-530t I installed the driver on the cd, I also have a cable modem from videotron plugged in a dlink wireless router (with good win7 64 bit driver! ...
Network & Sharing
Backup no longer works
Haven't run a backup with Backup and Restore for a while as I've been using Geniesoft Timeline, but I like to keep 2 backups and run B&R occasionally to an external drive M:. Today, I have the problem shown in screenshot attached. Not sure what it means. The external drive is accessible as I can...
Backup and Restore
Mute no longer Works
Well I had an issue with my volume randomly turning itself down it seems to have solved itself I dunno how but i am not questioning it... now my mute on my quick launch buttons no longer functions would this be an indication of a driver issue with the quick launch or the sound device driver??
Sound & Audio


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:36.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App