Searching for Text within a file

fsbgav

Junior Member
Sep 17, 2014
2
0
0
Hi

This is my first visit to this forum so excuse me if this is posted in the wrong place.

Here's my conundrum...

I have a large number of files that I use regularly to copy and paste sections from when creating official letters. I would find the text I needed by using the 'search for text within a file' ability within the search facility in Windows Explorer.

Recently my company switched to Windows Virtual Desktop for all users. In doing so they have disabled the 'search for text within a file' ability within the search facility in Windows.

I asked if this could be enabled, and met with a resounding 'No'.

The cmd window function is also disabled so I cannot run grep.

I have tried to install other file search applications but only administrators can install applications.

Does anyone know any other method how I can search for text within files (either locally or on a network drive), that doesn't need any of the above. I have tried Google but have had no luck.

Cheers

fsbgav
 

ninaholic37

Golden Member
Apr 13, 2012
1,883
31
91
I also find the "search within all files in a directory/area" feature very useful. I'm curious if you can create a batch file and run grep or find/findstr through that?
 
Last edited:

Squeetard

Senior member
Nov 13, 2004
815
7
76
Use a word macro. Here is a sample below of a bulk search and replace, you could just have it stop when it finds the text. Close the doc if it does not:

Sub FindReplaceAllDocsInFolder( )
Dim i As Integer
Dim doc As Document
Dim rng As Range

With Application.FileSearch
.NewSearch
.LookIn = "B:\Attachments\"
.SearchSubFolders = False
.FileType = msoFileTypeWordDocuments
If Not .Execute( ) = 0 Then
For i = 1 To .FoundFiles.Count
Set doc = Documents.Open(.FoundFiles(i))
Set rng = doc.Range
With rng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Andy"
.Replacement.Text = "Matt"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With

doc.Save
doc.Close

Set rng = Nothing
Set doc = Nothing
Next i
Else
MsgBox "No files matched " & .FileName
End If
End With
End Sub
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
id suggest moving to something like OneNote for this, i know that doesnt resolve your search issue right away, but it would work pretty well for what you are doing. each "document" gets copied into a page in one note, which is excellent at searching everything in a notebook. then copy and paste from there.

also:
http://docfetcher.sourceforge.net/en/download.html

have not used it or tried it. people at work love AgentRansack and this is an alternative. you can get the portable edition and just unzip it to your documents folder

3rd option: work slow and when you boss complains gut IT in the firing line. im an IT guy and i like to solve user problems, which may or may not be hard in a larger environment...but sometimes IT needs a kick in the pants too.
 

Binky

Diamond Member
Oct 9, 1999
4,046
4
81
Get your stupid admins to install something like AgentRansack or its big brother, File Locator Pro.
 

fsbgav

Junior Member
Sep 17, 2014
2
0
0
Thanks for all the suggestions...will give them a go.

I work for the government so giving the admins a hard time only pisses them off as their bound by stipulations from higher up.
 
Last edited:

stlcardinals

Senior member
Sep 15, 2005
729
0
76
I work for the government

Should of mentioned this earlier, I really doubt that the Admins will change their mind on installing anything. They are probably bound by (more than likely stupid) Federal regulations.

I second the OneNote suggestion, though to me it sounds like custom templates would also do the job.