Need help with opening text file in custom app

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
machone
Posts: 31
Joined: 01 Oct 2012 18:36

Need help with opening text file in custom app

#1 Post by machone » 17 Apr 2013 07:12

I've got part of a batch file I'm trying to use to do 2 things, the first is to grab a recursive directory listing of specific files in a folder structure, and the second is to open the resulting text file in a specific text editor. The problem I'm having is the path of the text file isn't being recognized. It's being looked for in the text editor program directory, but I need this to be able to open the text file in whatever directory I've created the file.. Here's what I have so far:

Code: Select all

@echo off
dir /b /s "CONSTANT_STRING*.tif" > composite.bat
TIMEOUT /T 3
setlocal
set cmd=start "" /d "D:\utility\TED Notepad 6" "tednpad.exe"
%cmd% "\composite.bat"

When this runs, for example, from E:\some folder\some sub folder\ it creates composite.bat in that folder just fine, but then when it opens Ted Notepad, it looks for composite.bat in the Ted Notepad program directory, and of course that's not where it is, so it fails.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Need help with opening text file in custom app

#2 Post by foxidrive » 17 Apr 2013 07:56

Try this:

Code: Select all

@echo off
dir /b /s /a-d "CONSTANT_STRING*.tif" > composite.bat
start "" "D:\utility\TED Notepad 6\tednpad.exe" "composite.bat"

machone
Posts: 31
Joined: 01 Oct 2012 18:36

Re: Need help with opening text file in custom app

#3 Post by machone » 17 Apr 2013 12:56

Awesome, works beautifully. Thank you!

Post Reply