Search found 7 matches

by nohj
15 Sep 2015 12:43
Forum: DOS Batch Forum
Topic: Searching for text in a file to discover the folder path
Replies: 15
Views: 7743

Re: Searching for text in a file to discover the folder path

Squashman wrote:You need to use delayed expansion.
http://www.robvanderwoude.com/variableexpansion.php



Just read through it, worked perfectly thanks Squashman
by nohj
15 Sep 2015 11:12
Forum: DOS Batch Forum
Topic: Searching for text in a file to discover the folder path
Replies: 15
Views: 7743

Re: Searching for text in a file to discover the folder path

Sorry about the obscurity, sometimes I don't know what I want haha Just wanted to check if this was valid copy /y "c:\folder1\*.txt" "%%~dpa\exampleFolder\subFolder\" Because I didn't have access to my computer to test it myself, as I've been travelling. This is what I'm working ...
by nohj
11 Sep 2015 13:11
Forum: DOS Batch Forum
Topic: Searching for text in a file to discover the folder path
Replies: 15
Views: 7743

Re: Searching for text in a file to discover the folder path

Appreciate the help, thats exactly what I'm looking for. can I indicate a specific folder within the directory that origin.txt is inside like so: copy /y "c:\folder1\*.txt" "%%~dpa\exampleFolder\subFolder\" I'm unsure of the use of /b, what does "Indicates a Binary File"...
by nohj
10 Sep 2015 14:15
Forum: DOS Batch Forum
Topic: Searching for text in a file to discover the folder path
Replies: 15
Views: 7743

Re: Searching for text in a file to discover the folder path

Wow that's awesome, it's exactly what I was looking for, definitely appreciate the help. I have a new question in regards to this, can I use findstr to find every instance of the file origin.txt ? So for example, instead of reading origin.txt at all to find the correct directory, can it just for exa...
by nohj
06 Sep 2015 11:37
Forum: DOS Batch Forum
Topic: Searching for text in a file to discover the folder path
Replies: 15
Views: 7743

Re: Newbie needs help

@echo off set "folder=" for /r "%appdata%" %%a in (origin.txt*) do find "last words" <"%%a" >nul && set "folder=%%~dpa" if defined folder echo keywords were found in at least once spot = "%folder%" if not defined folder echo tough!...
by nohj
06 Sep 2015 00:34
Forum: DOS Batch Forum
Topic: Searching for text in a file to discover the folder path
Replies: 15
Views: 7743

Re: Newbie needs help

Yeah I'm not great explaining things lol I've updated the stack flow question and I'll post it here as well.
by nohj
04 Sep 2015 17:42
Forum: DOS Batch Forum
Topic: Searching for text in a file to discover the folder path
Replies: 15
Views: 7743

Searching for text in a file to discover the folder path

EDIT: To clarify what I'm looking to do is move a few files into a data folder of an application. The application is installed into Program Files but it keeps data inside app data. The folder name looks something like this 76053ADAJSQDUC4975 Problem is that it's unique to every instance of the appli...