New
#11
Hi WindowsStar,
I got it working in CMD with a LOT of help from various sources. So if I caught you soon enough please don't spend too much time on a VBS solution.
I can paste the .bat if you want to see it.
Thanks,
Tux
Hi WindowsStar,
I got it working in CMD with a LOT of help from various sources. So if I caught you soon enough please don't spend too much time on a VBS solution.
I can paste the .bat if you want to see it.
Thanks,
Tux
Sure paste it here...
Attached. The only thing I'd like to add possibly is a progress timer for processing large directories.
Hi Tuxalot,
Nice Work!
BTW - It doesn't work for me unless I set the current path in the batch at the start.
I would also recommend using variables for the program files location rather than hardcoding it to the C drive.Code::: SET Automatically the current path (i.e. the path that this is run from) set curpath=%~dp0 :: CD to the current path pushd %curpath%
In regards the bit of code that you didn't know, the %~dp0 is for expanding drive letters and paths.Code:%programfiles%\SHCK\SHCKdocs
If you want to add a progress timer, try counting the total number of files in the location, here's some code for C:\ to get you started.
Now set up a loop that displays an ongoing count after one of your %outfile% write entries.Code:dir "C:\" /b | find /v /c "::"
Hope this helps.
Thanks for the insight Tim.
I wonder why you need to set the current path? While it seems like a good idea anyways, it was working for me.BTW - It doesn't work for me unless I set the current path in the batch at the start.
I've incorporated these changes. I may wait on the progress timer idea...I've found a more pressing issue that I need to address. It turns out that the application that uses these text files, needs the files in ascending alpha order. Argggg!I would also recommend using variables for the program files location rather than hardcoding it to the C drive.
Thinking more about this, what about this approach?
To summarize, the remaining goal is to sort Output1 and Output2. Output1 is FQPN of zip and mp3 files. Output2 is just a sorted list of filenames.
So if the code can produce a temporary outputX that looks like this:
file1.zip(a delimiter of some type)D:\folder1\folder2\folder3\etc...\file1.zip
Now, we can sort on file name and build outputX. So this is the code for that:
After, we read OutFileXS back into the script and split the data into two separate files at the delimiter (I chose # as the delimiter) yielding Output1, Output2. Here is the code for that but it's not working:Code:PushD "%_Source%" For /F "Tokens=* Delims=" %%g In ('Dir /A-D /B /S *.zip 2^>Nul') Do Echo."%%~ng"\#"%%~dpng">>"%_OutFileX%" SORT "%_OutFileX%" > "%_OutFileXS%"
Any help is appreciated.Code:for /F "Tokens=1 delims=#" %%a In ("%_OutFileXS%") Do Echo.%%a>>"%_OutFile2%"
Tux.
Last edited by tuxalot; 02 Jan 2010 at 20:48.
Code is done now. I thank all who helped me with this. I can post the batch if anyone wants to see it.
Thanks again,
Tux.
Please post it. Would like to see what you came up with. Plus others maybe able to use it.
I'm working through some tests with the script today and will post later.
Tux.
Hi there
why not start with something REALLY SIMPLE such as a bog standard DOS command.
FOR %%i IN (directory\*.*) DO echo %%i >> list.txt
This should put the name of every file in directory into list.txt
You can route it to a spreadsheet or whatever as well.
Cheers
jimbo
jimbo45: Could do...but then would still have to parse out the extensions that I need, filter the ones I do not, and build the two output files that my app needs. So I don't see the point. Unless of course I could come up with a way to execute the batch faster, that would be sweet.
I cannot take much (if any) credit for the attached batch. It was a melding of efforts from various sources. But it works and I'm grateful!
Thanks all for the assistance on this.
Just change the extension to bat and run.
Cheers,
Tux.