+ Reply to Thread
Results 1 to 5 of 5

Batch file tree structure

  1. #1
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Batch file tree structure

    I'll bet there's plenty of people around who know their way round batch files, they really ain't my thing, I've written the below to convert all .md files to .docx, it works, but I want the output files in another location with the same file structure (there is a file tree in Documentation) - assume I already have the same file structure here: "U:\Documentation", I suspect that there's a way of removing parts of the file path, specifically anything before "Documentation", but I can't suss it out.

    Any ideas?

    I've attached the code, since if I try and post it, the forum has a hissy fit
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Batch file tree structure

    Hi Kyle,

    I'm not exactly sure what you want, but it seems like you want to put the output in a different folder. I've attached a zip file containing the following 3 files, which were tested and working on a Vista 32 bit system. I put both .bat files in the source folder. To test, I double clicked file Kyle123Master.bat.

    File Kyle123forum.bat
    Please Login or Register  to view this content.
    I commented out the pause above because it was easier for me to test the .bat file by running the above file from a Master .bat file that redirects output to a file. It is almost impossible for me to read the output in the .cmd window.

    File Kyle123Master.bat
    Please Login or Register  to view this content.
    Ouput in file x.txt (I had two .md test files in the source folder):
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Batch file tree structure

    Thanks Lewis, it doesn't do what I want I'm afraid, using your code (tweaked for reading), I get:
    Please Login or Register  to view this content.
    I want:
    Please Login or Register  to view this content.
    Is that any clearer?

    So that it mirrors the file structure

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Batch file tree structure

    I think I see what you want now. Hopefully lines 4 and 5 of your what 'I want' are incorrect, otherwise my solution is also incorrect. See the code below and the attached zip file that contains all 3 files.

    Please note that my source folder names are still in the .bat files and must be commented out and replaced with your folder names.

    Try the following file Kyle123forumA.bat:
    Please Login or Register  to view this content.
    File Kyle123Master.bat:
    Please Login or Register  to view this content.
    My output file x.txt:
    Please Login or Register  to view this content.
    Lewis

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Batch file tree structure

    Thanks Lewis, that's great - I'll try it in the morning it's 2130 now so not at work. You're right my "I want" is incorrect, your output is what I'm after

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Tree Structure with +/- button
    By meatballv10 in forum Excel General
    Replies: 4
    Last Post: 12-13-2012, 11:10 AM
  2. Tree structure drop-down?
    By zudecke in forum Excel General
    Replies: 1
    Last Post: 06-24-2010, 05:11 AM
  3. Extensive Tree Structure
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2010, 09:10 AM
  4. tree structure output
    By genesis1977 in forum Excel General
    Replies: 3
    Last Post: 08-02-2007, 09:02 AM
  5. [SOLVED] Tree Structure
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-24-2005, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1