1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Update script help

Discussion in 'Software Development' started by MordyT, Jan 31, 2013.

Thread Status:
Not open for further replies.
  1. MordyT

    MordyT Thread Starter

    Joined:
    Oct 8, 2007
    Messages:
    48
    Hello,
    I am trying to write a script that can do a batch update.

    Here is the general concept:

    C:\Master\Updates\1\ <-- all the files for program 1 are stored in here
    C:\Files\1\a <-- a is a copy of the C:\Master\Updates\1 folder with a few customizations.
    C:\Files\1\b <-- b is a copy of the C:\Master\Updates\1 folder with a few customizations.
    C:\Files\1\c <-- c is a copy of the C:\Master\Updates\1 folder with a few customizations.

    So when folder C:\Master\Updates\1\ is updated I want to run this batch file (or whatever lang is chosen) to update all the folders in C:\Files\1\. What it does is copy all the files in C:\Master\Updates\1\ and then applies it to C:\Files\1\a\. Then it repeats with C:\Files\1\b\ and then with C:\Files\1\c\

    All this I can script up, the problem I have is the number of folders in C:\Files\1\ and their names change all the time, which means what I really need is a way to generate a list of folders name inside of C:\Files\1\ and save it to a text file (one name per line). The rest I think this script can handle.

    for /f %%a in c:Files\1\uplist.txt do xcopy /y/e c:\master\update\1\*.* c:\Files\1\%%a\
    pause

    If anyone knows how I could get a list of current folder names? Will the script above work for what I need?
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    dir c:\Files\1\* /ad /b>folderlist.txt
     
  3. MordyT

    MordyT Thread Starter

    Joined:
    Oct 8, 2007
    Messages:
    48
    Awesome. That was exactly the code I needed. I did need to mod my code, but it is working now.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1087674

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice