Use Windows Search to find a lengthy list of files - windows-search

I am searching for a relatively large collection (2000+) of files within a group of specific folders. The specific folder (and subsequent sub-folders) are indexed locations. I know the names and paths of all of the files. They are listed in an excel spreadsheet.
I wish to display them all in one saved search.
I am able to compile a search using AQS: name: filename1 OR name: filename2 .......OR name: filenameN AND Word. This code works well for a few file names. However, I have a list of about 2000 files. And copy and paste into the search window does not seem to work with such a large collection of search criteria.
I did try doing the paste with VBA. But I think my query is too large.
Also, because I have so many search criteria, I suspect compiling a .ms-search file from scratch will not be practical.
My question is: Is there a more elegant way of accomplishing this? Possibly something combining a series of excel formulas with the CMD Prompt.
Thank You

For anyone interested.
I solved my problem using VB script. Instead of creating a saved search file, I will manually create a folder and "import" the links to it:
Set oWS = WScript.CreateObject("WScript.Shell")
sLinkFile = "C:\MyShortcut.LNK"
Set oLink = oWS.CreateShortcut(sLinkFile)
oLink.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE"
oLink.Save
I used Excel formulas to concatenate the script and my known paths. Copy and paste to a .vbs file.

Related

UFT OTA - Get ID of copied test set folder

I have (after FOREVER) figured out how to copy a test set folder from one location to another and rename it using a explicit folder id. Now, I want to rename the new folder right after pasting, so the id will NOT be known. I have found absolutely NOTHING on how I can do this.
I'm trying my hardest to use the online resource for OTA, but it's really unhelpful unless you already know the language. I can't seem to find what I need, so please don't suggest that.
Thanks in advance. Currently very frustrated and ready to throw out my computer.
Here's what I have to copy, paste, and rename a specific node by id
Set qcConnection = QCutil.QCConnection
copiedTestSet = qcConnection.TestSetTreeManager.CopyToClipboard(3)
QCConnection.TestSetFactory.PasteFromClipboard copiedTestSet,6,2,1
Set renameTest = qcconnection.TestSetTreeManager.NodeByID(30)
print renameTest.Name
renameTest.Name = "Rename Test"
renameTest.Post
Set renameTest = Nothing
Set copiedTestSet = Nothing
You will know the folder name of the pasted folder, because it should be same as the copied folder, you can simple search for the pasted folder with name under the parent folder.
Below page have few functions which can help you
https://github.com/sumeet-kushwah/ALM_OTA_Wrapper/blob/master/ALM_Wrapper/TestLabFolders.cs
There are three functions you should search for
FindChildFolderByName
FindChildFolders
GetTestSetFolder
I was able to find what I needed using sumeet's suggestion above. My exact code is below using variables because I need to be able to run this with any folder. It runs right after the paste command above. I had to insert a wait after pasting for some reason, but it works for now. I'll trouble shoot that later
Set renameTest = qcconnection.TestSetTreeManager.NodeByPath(strPath & "\" & strEventFolder)

How can I find duplicately named files in Windows?

I am organizing a large Windows folder with many subfolders (with sub folders, etc...), in which files have been saved multiple times in different locations. Can anyone figure out how to identify all files with duplicate names across multiple directories? Some ways I am thinking about include:
A command or series of that could be run in the command line (cmd). Perhaps DIR could be a start...
Possibly a tool that comes with Windows
Possibly a way to specify in search to find duplicate filenames
NOT a separate downloadable tool (those could carry unwanted security risks).
I would like to be able to know the directory paths and filename to the duplicate file(s).
Not yet a full solution, but I think I am on the right track, further comments would be appreciated:
From CMD (start, type cmd):
DIR "C:\mypath" /S > filemap.txt
This should generate a recursive list of files within the directories.
TODO: Find a way to have filenames on the left side of the list
From outside cmd:
Open filemap.txt
Copy and paste the results into Excel
From Excel:
Sort the data
Add in the next column logic to compare to see if the current text = previous text (for filename)
Filter on that row to identify all duplicates
To see where the duplicates are located:
Search filemap.txt for the duplicate filenames identified above and note their directory location.
Note: I plan to update this as I get further along, or if a better solution is found.

Applescript/automator : move all the files listed in a document

I'm completely rebuilding a shared iTunes library and this needs to be team work.
I found a way to work the XML database in Google Drive so that we can all edit the track list simultaneously (>7500 entries). The spreadsheet contains for every song the path to the corresponding file.
Now I need a script to move the tracks listed in that spreadsheet to a common folder, so I can separate the songs we decided to keep from the ones we don't want anymore.
The blueprint I imagined for the code is basically :
Get the paths list (txt, csv, etc. doesn't matter) and store it as
an array.
Rotate through that array and select+move to a common folder each file pointed by the paths.
I'm not expecting any ready-to-use solution, but I would really appreciate some tips or pieces of advice that could make me spare a lot of time.
I also have to admit I have limited knowledge in Mac OS X programming (more used to web and windows environments) and have no experience in Applescripts.
However, I feel that what I'm trying to achieve is pretty straightforward and could help other people as well.
there are just 2 items not clear in your request :
1) what is the file type in which file paths are stored ? I assumed it is a text file
2) which format the paths have ? is it Unix format (like HD/Users/My_User/Desktop/My_Song), or is is a Finder format (like HD:Users:My_User:Desktop:My_Song). I assume it is a finder format
then script bellow asks you to select the text file, read it, ask you to select destination folder and move every file described in text file to the destination folder.
tell application "Finder"
set TextFile to (choose file with prompt "Select your text file" of type {"txt"})
set My_Folder to choose folder with prompt "Select your destination folder"
set List_files to paragraphs of (read TextFile)
move List_files to My_Folder
end tell
the "move" can be changed to a "copy", if required
Thank you so much to both of you for your answers.
Regarding pbell's questions :
1. I did not specify the format of the file containing the paths because I wasn't sure which ones the script could handle. Now I will make sure it is in a txt format.
2. The paths are actually il a Unix format, but seeing your example it looks pretty easy to parse. Can I just replace every "/" with a ":" ..?
I will try your code this afternoon. Again thanks a lot for caring and for sharing your time and knowledge.
Terence
Works like a charm !
Thank you very much pbell, your code works perfectly. I just had to make a txt file with Finder-formatted paths like so :
Macintosh HD:Users:FirstnameSurname:Desktop:Music:November-7:Season 3:04 Parasite.mp3
Macintosh HD:Users:FirstnameSurname:Desktop:Music:November-7:Season 3:05 Nowhere.mp3
Macintosh HD:Users:FirstnameSurname:Desktop:Music:November-7:Season 3:06 Amber Light.mp3
We spared so much time thanks to you.
Have a great day,
Terence

vbscript to read text files and extract data

i am in need of script to extract number of note-ref_ and #ref_ presence in all html files
my folder structure will be
D:\Count_Test
wherein lot of folders and sub-folder will contain and in each sub-folder will have a ref.html, text.html file will contain note-ref_ and #ref_ text (apart these files, some other files such as xml, txt and imges and css sub-folder will contain)
I need to count for every single file how many times note-ref_ and #ref_ appeared and the results needs to capture in .csv file
can anybody help me by providing solution to extract text into csv file
Suggestions:
Use the Scripting.FileSystemObject (FSO) to walk through files and sub folders to identify the scope of your actions. Alternatively, you could capture the output of DIR /s /b D:\Count_Test*.html.
Once you know the list of files you'll need to open, you should read each of them using the OpenTextFile function of the FSO and loop through each row. When you find what you're looking for, increase some sort of counter - perhaps in an array.
Finally once you've finished collecting the data, you can output your results by once again doing OpenTextFile, but this time opening your CSV file location and writing the data you've collected in the appropriate format.

Copy Update Create VBScript

Please help me to acheive the following using VBScript
1.Messagebox with three tabs Copy,Update,Cancel and displaying "Welcome to the AVG
definition fies copier/updater module.Click on Copy to copy files or Update to update
definition files.
2.If copy selected,the drive letter from where the script is run(usb drive) stored as
variable,directory "(usb drive)Update" created if not exist,new and files not existing
in update folder copied to(eg=xcopy /d), from
"%allusersprofile%\applic~1\avg8\update\download"
3.If possible display message 'copying files, while copying.After completion of
copying display 'Files copied successfully'.
4.If update selected,tdirectory "c:\Update" created if not exist,new and files not
existing in "c:\Update" copied to, from (usb drive) update folder
5.If possible display message 'Updating files' while copying.After completion of
updating, display 'Files Updated successfully'.After clicking OK exit and start
"C:\progra~1\avg\avg8\avgui.exe"
Well, the way that I would do it is to make stand alone functions for each of the functional tasks that you have then wrap those functions inside an HTA to give you the interface layer that you want.
As I understand from your other question, you managed to find solutions to most of these tasks yourself. Here's a tip for your #2, which I haven't noticed implemented in that your script.
2.If copy selected,the drive letter from where the script is run(usb drive) stored as variable
You can retrieve the full path of the current script file using the WScript.ScriptFullName property and then use the FileSystemObject.GetDriveName method to extract the drive letter:
Set objFSO = CreateObject("Scripting.FileSystemObject")
strUSBDrive = objFSO.GetDriveName(WScript.ScriptFullName)
This will give you the drive letter followed by a colon (e.g. J:). You can then concatenate this value with the target folder name to get the full path, e.g.:
MsgBox strUSBDrive & "\Update"

Resources